Esempio n. 1
0
    /// <summary>
    /// 复制(深拷贝)
    /// </summary>
    protected override void toCopy(BaseData data)
    {
        if (!(data is ItemData))
        {
            return;
        }

        ItemData mData = (ItemData)data;

        this.id = mData.id;

        this.num = mData.num;

        this.isBind = mData.isBind;

        this.disableTime = mData.disableTime;

        if (mData.identity != null)
        {
            this.identity = (ItemIdentityData)mData.identity.clone();
        }
        else
        {
            this.identity = null;
        }

        this.hasRedPoint = mData.hasRedPoint;
    }
Esempio n. 2
0
 /// <summary>
 /// 回池
 /// </summary>
 protected override void toRelease(DataPool pool)
 {
     this.id          = 0;
     this.num         = 0;
     this.isBind      = false;
     this.disableTime = 0L;
     this.identity    = null;
     this.hasRedPoint = false;
 }
Esempio n. 3
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        ItemIdentityData mData = (ItemIdentityData)data;

        if (this.type != mData.type)
        {
            return(false);
        }

        return(true);
    }
Esempio n. 4
0
    /// <summary>
    /// 复制(深拷贝)
    /// </summary>
    protected override void toCopy(BaseData data)
    {
        if (!(data is ItemIdentityData))
        {
            return;
        }

        ItemIdentityData mData = (ItemIdentityData)data;

        this.type = mData.type;
    }
Esempio n. 5
0
    /// <summary>
    /// 复制(潜拷贝)
    /// </summary>
    protected override void toShadowCopy(BaseData data)
    {
        if (!(data is ItemData))
        {
            return;
        }

        ItemData mData = (ItemData)data;

        this.id          = mData.id;
        this.num         = mData.num;
        this.isBind      = mData.isBind;
        this.disableTime = mData.disableTime;
        this.identity    = mData.identity;
        this.hasRedPoint = mData.hasRedPoint;
    }
Esempio n. 6
0
    /// <summary>
    /// 读取字节流(完整版)
    /// </summary>
    protected override void toReadBytesFull(BytesReadStream stream)
    {
        stream.startReadObj();

        this.id = stream.readInt();

        this.num = stream.readInt();

        this.isBind = stream.readBoolean();

        this.disableTime = stream.readLong();

        if (stream.readBoolean())
        {
            BaseData identityT = stream.readDataFullNotNull();
            if (identityT != null)
            {
                if (identityT is ItemIdentityData)
                {
                    this.identity = (ItemIdentityData)identityT;
                }
                else
                {
                    this.identity = new ItemIdentityData();
                    if (!(identityT.GetType().IsAssignableFrom(typeof(ItemIdentityData))))
                    {
                        stream.throwTypeReadError(typeof(ItemIdentityData), identityT.GetType());
                    }
                    this.identity.shadowCopy(identityT);
                }
            }
            else
            {
                this.identity = null;
            }
        }
        else
        {
            this.identity = null;
        }

        this.hasRedPoint = stream.readBoolean();

        stream.endReadObj();
    }
Esempio n. 7
0
    /// <summary>
    /// 读取字节流(简版)
    /// </summary>
    protected override void toReadBytesSimple(BytesReadStream stream)
    {
        this.id = stream.readInt();

        this.num = stream.readInt();

        this.isBind = stream.readBoolean();

        this.disableTime = stream.readLong();

        if (stream.readBoolean())
        {
            this.identity = (ItemIdentityData)stream.readDataSimpleNotNull();
        }
        else
        {
            this.identity = null;
        }

        this.hasRedPoint = stream.readBoolean();
    }
Esempio n. 8
0
        public override ItemIdentityData createItemIdentityByType(int type)
        {
            if (!_g2)
            {
                _m2 = instance.Type.GetMethod("createItemIdentityByType", 1);
                _g2 = true;
            }

            if (_m2 != null && !_b2)
            {
                _b2    = true;
                _p1[0] = type;
                ItemIdentityData re = (ItemIdentityData)appdomain.Invoke(_m2, instance, _p1);
                _p1[0] = null;
                _b2    = false;
                return(re);
            }
            else
            {
                return(base.createItemIdentityByType(type));
            }
        }
Esempio n. 9
0
 public void initIdentityByType(int type)
 {
     identity      = BaseC.logic.createItemIdentityByType(type);
     identity.type = type;      //设置type
 }