<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: Client_Game_Packet.proto

namespace Game\Protobuf;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * 同步房间玩家数据
 *
 * Generated from protobuf message <code>Game.Protobuf.GCSyncCRoomPlayerInfo</code>
 */
class GCSyncCRoomPlayerInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * 1 新增
     *
     * Generated from protobuf field <code>int32 Code = 1;</code>
     */
    protected $Code = 0;
    /**
     * Generated from protobuf field <code>.Game.Protobuf.CRoomPlayer Player = 2;</code>
     */
    protected $Player = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $Code
     *           1 新增
     *     @type \Game\Protobuf\CRoomPlayer $Player
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\ClientGamePacket::initOnce();
        parent::__construct($data);
    }

    /**
     * 1 新增
     *
     * Generated from protobuf field <code>int32 Code = 1;</code>
     * @return int
     */
    public function getCode()
    {
        return $this->Code;
    }

    /**
     * 1 新增
     *
     * Generated from protobuf field <code>int32 Code = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setCode($var)
    {
        GPBUtil::checkInt32($var);
        $this->Code = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.Game.Protobuf.CRoomPlayer Player = 2;</code>
     * @return \Game\Protobuf\CRoomPlayer|null
     */
    public function getPlayer()
    {
        return $this->Player;
    }

    public function hasPlayer()
    {
        return isset($this->Player);
    }

    public function clearPlayer()
    {
        unset($this->Player);
    }

    /**
     * Generated from protobuf field <code>.Game.Protobuf.CRoomPlayer Player = 2;</code>
     * @param \Game\Protobuf\CRoomPlayer $var
     * @return $this
     */
    public function setPlayer($var)
    {
        GPBUtil::checkMessage($var, \Game\Protobuf\CRoomPlayer::class);
        $this->Player = $var;

        return $this;
    }

}

