/// <summary>
    /// 读取字节流(完整版)
    /// </summary>
    protected override void toReadBytesFull(BytesReadStream stream)
    {
        base.toReadBytesFull(stream);

        stream.startReadObj();

        int funcListLen = stream.readLen();

        if (this.funcList == null || this.funcList.Length != funcListLen)
        {
            this.funcList = new TriggerFuncData[funcListLen];
        }
        TriggerFuncData[] funcListT = this.funcList;
        for (int funcListI = 0; funcListI < funcListLen; ++funcListI)
        {
            TriggerFuncData funcListV;
            BaseData        funcListVT = stream.readDataFullNotNull();
            if (funcListVT != null)
            {
                if (funcListVT is TriggerFuncData)
                {
                    funcListV = (TriggerFuncData)funcListVT;
                }
                else
                {
                    funcListV = new TriggerFuncData();
                    if (!(funcListVT.GetType().IsAssignableFrom(typeof(TriggerFuncData))))
                    {
                        stream.throwTypeReadError(typeof(TriggerFuncData), funcListVT.GetType());
                    }
                    funcListV.shadowCopy(funcListVT);
                }
            }
            else
            {
                funcListV = null;
            }

            funcListT[funcListI] = funcListV;
        }

        stream.endReadObj();
    }
Exemple #2
0
    /// <summary>
    /// 读取字节流(完整版)
    /// </summary>
    protected override void toReadBytesFull(BytesReadStream stream)
    {
        stream.startReadObj();

        this.id = stream.readInt();

        this.name = stream.readUTF();

        this.groupType = stream.readInt();

        this.groupID = stream.readInt();

        this.isOpen = stream.readBoolean();

        this.priority = stream.readInt();

        int eventsLen = stream.readLen();

        if (this.events == null || this.events.Length != eventsLen)
        {
            this.events = new TriggerFuncData[eventsLen];
        }
        TriggerFuncData[] eventsT = this.events;
        for (int eventsI = 0; eventsI < eventsLen; ++eventsI)
        {
            TriggerFuncData eventsV;
            BaseData        eventsVT = stream.readDataFullNotNull();
            if (eventsVT != null)
            {
                if (eventsVT is TriggerFuncData)
                {
                    eventsV = (TriggerFuncData)eventsVT;
                }
                else
                {
                    eventsV = new TriggerFuncData();
                    if (!(eventsVT.GetType().IsAssignableFrom(typeof(TriggerFuncData))))
                    {
                        stream.throwTypeReadError(typeof(TriggerFuncData), eventsVT.GetType());
                    }
                    eventsV.shadowCopy(eventsVT);
                }
            }
            else
            {
                eventsV = null;
            }

            eventsT[eventsI] = eventsV;
        }

        int conditionsLen = stream.readLen();

        if (this.conditions == null || this.conditions.Length != conditionsLen)
        {
            this.conditions = new TriggerFuncData[conditionsLen];
        }
        TriggerFuncData[] conditionsT = this.conditions;
        for (int conditionsI = 0; conditionsI < conditionsLen; ++conditionsI)
        {
            TriggerFuncData conditionsV;
            BaseData        conditionsVT = stream.readDataFullNotNull();
            if (conditionsVT != null)
            {
                if (conditionsVT is TriggerFuncData)
                {
                    conditionsV = (TriggerFuncData)conditionsVT;
                }
                else
                {
                    conditionsV = new TriggerFuncData();
                    if (!(conditionsVT.GetType().IsAssignableFrom(typeof(TriggerFuncData))))
                    {
                        stream.throwTypeReadError(typeof(TriggerFuncData), conditionsVT.GetType());
                    }
                    conditionsV.shadowCopy(conditionsVT);
                }
            }
            else
            {
                conditionsV = null;
            }

            conditionsT[conditionsI] = conditionsV;
        }

        int actionsLen = stream.readLen();

        if (this.actions == null || this.actions.Length != actionsLen)
        {
            this.actions = new TriggerFuncData[actionsLen];
        }
        TriggerFuncData[] actionsT = this.actions;
        for (int actionsI = 0; actionsI < actionsLen; ++actionsI)
        {
            TriggerFuncData actionsV;
            BaseData        actionsVT = stream.readDataFullNotNull();
            if (actionsVT != null)
            {
                if (actionsVT is TriggerFuncData)
                {
                    actionsV = (TriggerFuncData)actionsVT;
                }
                else
                {
                    actionsV = new TriggerFuncData();
                    if (!(actionsVT.GetType().IsAssignableFrom(typeof(TriggerFuncData))))
                    {
                        stream.throwTypeReadError(typeof(TriggerFuncData), actionsVT.GetType());
                    }
                    actionsV.shadowCopy(actionsVT);
                }
            }
            else
            {
                actionsV = null;
            }

            actionsT[actionsI] = actionsV;
        }

        stream.endReadObj();
    }