<?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;

/**
 *--------------------------邮件模块start-----------------------------//
 *单个邮件信息
 *
 * Generated from protobuf message <code>Game.Protobuf.MailSingle</code>
 */
class MailSingle extends \Google\Protobuf\Internal\Message
{
    /**
     *邮件唯一ID
     *
     * Generated from protobuf field <code>uint64 MailId = 1;</code>
     */
    protected $MailId = 0;
    /**
     *邮件表ID
     *
     * Generated from protobuf field <code>int32 MailTableId = 2;</code>
     */
    protected $MailTableId = 0;
    /**
     *接收时间
     *
     * Generated from protobuf field <code>uint64 RecvTime = 3;</code>
     */
    protected $RecvTime = 0;
    /**
     *邮件的状态 0-未读 1-已读 2-未领取 3-已领取   4-已删除 
     *
     * Generated from protobuf field <code>int32 State = 4;</code>
     */
    protected $State = 0;
    /**
     *邮件附件道具 邮件类型为2时使用
     *
     * Generated from protobuf field <code>repeated .Game.Protobuf.MailReward Enclosure = 5;</code>
     */
    private $Enclosure;
    /**
     *发送邮件人Id, 系统邮件默认 0
     *
     * Generated from protobuf field <code>uint64 PlayerID = 6;</code>
     */
    protected $PlayerID = 0;
    /**
     * 部分类型邮件内容
     *
     * Generated from protobuf field <code>string Content = 7;</code>
     */
    protected $Content = '';
    /**
     *替换内容
     *
     * Generated from protobuf field <code>.Game.Protobuf.ReplaceString RepString = 8;</code>
     */
    protected $RepString = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $MailId
     *          邮件唯一ID
     *     @type int $MailTableId
     *          邮件表ID
     *     @type int|string $RecvTime
     *          接收时间
     *     @type int $State
     *          邮件的状态 0-未读 1-已读 2-未领取 3-已领取   4-已删除 
     *     @type \Game\Protobuf\MailReward[]|\Google\Protobuf\Internal\RepeatedField $Enclosure
     *          邮件附件道具 邮件类型为2时使用
     *     @type int|string $PlayerID
     *          发送邮件人Id, 系统邮件默认 0
     *     @type string $Content
     *           部分类型邮件内容
     *     @type \Game\Protobuf\ReplaceString $RepString
     *          替换内容
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\ClientGamePacket::initOnce();
        parent::__construct($data);
    }

    /**
     *邮件唯一ID
     *
     * Generated from protobuf field <code>uint64 MailId = 1;</code>
     * @return int|string
     */
    public function getMailId()
    {
        return $this->MailId;
    }

    /**
     *邮件唯一ID
     *
     * Generated from protobuf field <code>uint64 MailId = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setMailId($var)
    {
        GPBUtil::checkUint64($var);
        $this->MailId = $var;

        return $this;
    }

    /**
     *邮件表ID
     *
     * Generated from protobuf field <code>int32 MailTableId = 2;</code>
     * @return int
     */
    public function getMailTableId()
    {
        return $this->MailTableId;
    }

    /**
     *邮件表ID
     *
     * Generated from protobuf field <code>int32 MailTableId = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setMailTableId($var)
    {
        GPBUtil::checkInt32($var);
        $this->MailTableId = $var;

        return $this;
    }

    /**
     *接收时间
     *
     * Generated from protobuf field <code>uint64 RecvTime = 3;</code>
     * @return int|string
     */
    public function getRecvTime()
    {
        return $this->RecvTime;
    }

    /**
     *接收时间
     *
     * Generated from protobuf field <code>uint64 RecvTime = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setRecvTime($var)
    {
        GPBUtil::checkUint64($var);
        $this->RecvTime = $var;

        return $this;
    }

    /**
     *邮件的状态 0-未读 1-已读 2-未领取 3-已领取   4-已删除 
     *
     * Generated from protobuf field <code>int32 State = 4;</code>
     * @return int
     */
    public function getState()
    {
        return $this->State;
    }

    /**
     *邮件的状态 0-未读 1-已读 2-未领取 3-已领取   4-已删除 
     *
     * Generated from protobuf field <code>int32 State = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkInt32($var);
        $this->State = $var;

        return $this;
    }

    /**
     *邮件附件道具 邮件类型为2时使用
     *
     * Generated from protobuf field <code>repeated .Game.Protobuf.MailReward Enclosure = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getEnclosure()
    {
        return $this->Enclosure;
    }

    /**
     *邮件附件道具 邮件类型为2时使用
     *
     * Generated from protobuf field <code>repeated .Game.Protobuf.MailReward Enclosure = 5;</code>
     * @param \Game\Protobuf\MailReward[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setEnclosure($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Game\Protobuf\MailReward::class);
        $this->Enclosure = $arr;

        return $this;
    }

    /**
     *发送邮件人Id, 系统邮件默认 0
     *
     * Generated from protobuf field <code>uint64 PlayerID = 6;</code>
     * @return int|string
     */
    public function getPlayerID()
    {
        return $this->PlayerID;
    }

    /**
     *发送邮件人Id, 系统邮件默认 0
     *
     * Generated from protobuf field <code>uint64 PlayerID = 6;</code>
     * @param int|string $var
     * @return $this
     */
    public function setPlayerID($var)
    {
        GPBUtil::checkUint64($var);
        $this->PlayerID = $var;

        return $this;
    }

    /**
     * 部分类型邮件内容
     *
     * Generated from protobuf field <code>string Content = 7;</code>
     * @return string
     */
    public function getContent()
    {
        return $this->Content;
    }

    /**
     * 部分类型邮件内容
     *
     * Generated from protobuf field <code>string Content = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setContent($var)
    {
        GPBUtil::checkString($var, True);
        $this->Content = $var;

        return $this;
    }

    /**
     *替换内容
     *
     * Generated from protobuf field <code>.Game.Protobuf.ReplaceString RepString = 8;</code>
     * @return \Game\Protobuf\ReplaceString|null
     */
    public function getRepString()
    {
        return $this->RepString;
    }

    public function hasRepString()
    {
        return isset($this->RepString);
    }

    public function clearRepString()
    {
        unset($this->RepString);
    }

    /**
     *替换内容
     *
     * Generated from protobuf field <code>.Game.Protobuf.ReplaceString RepString = 8;</code>
     * @param \Game\Protobuf\ReplaceString $var
     * @return $this
     */
    public function setRepString($var)
    {
        GPBUtil::checkMessage($var, \Game\Protobuf\ReplaceString::class);
        $this->RepString = $var;

        return $this;
    }

}

