示例#1
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        if (!base.toDataEquals(data))
        {
            return(false);
        }

        TriggerFuncListData mData = (TriggerFuncListData)data;

        if (mData.funcList != null)
        {
            if (this.funcList == null)
            {
                return(false);
            }
            if (this.funcList.Length != mData.funcList.Length)
            {
                return(false);
            }
            TriggerFuncData[] funcListT = this.funcList;
            TriggerFuncData[] funcListR = mData.funcList;
            int funcListLen             = funcListT.Length;
            for (int funcListI = 0; funcListI < funcListLen; ++funcListI)
            {
                TriggerFuncData funcListU = funcListT[funcListI];
                TriggerFuncData funcListV = funcListR[funcListI];
                if (funcListV != null)
                {
                    if (funcListU == null)
                    {
                        return(false);
                    }
                    if (!funcListU.dataEquals(funcListV))
                    {
                        return(false);
                    }
                }
                else
                {
                    if (funcListU != null)
                    {
                        return(false);
                    }
                }
            }
        }
        else
        {
            if (this.funcList != null)
            {
                return(false);
            }
        }

        return(true);
    }
示例#2
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        TriggerConfigData mData = (TriggerConfigData)data;

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

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

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

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

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

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

        if (mData.events != null)
        {
            if (this.events == null)
            {
                return(false);
            }
            if (this.events.Length != mData.events.Length)
            {
                return(false);
            }
            TriggerFuncData[] eventsT = this.events;
            TriggerFuncData[] eventsR = mData.events;
            int eventsLen             = eventsT.Length;
            for (int eventsI = 0; eventsI < eventsLen; ++eventsI)
            {
                TriggerFuncData eventsU = eventsT[eventsI];
                TriggerFuncData eventsV = eventsR[eventsI];
                if (eventsV != null)
                {
                    if (eventsU == null)
                    {
                        return(false);
                    }
                    if (!eventsU.dataEquals(eventsV))
                    {
                        return(false);
                    }
                }
                else
                {
                    if (eventsU != null)
                    {
                        return(false);
                    }
                }
            }
        }
        else
        {
            if (this.events != null)
            {
                return(false);
            }
        }

        if (mData.conditions != null)
        {
            if (this.conditions == null)
            {
                return(false);
            }
            if (this.conditions.Length != mData.conditions.Length)
            {
                return(false);
            }
            TriggerFuncData[] conditionsT = this.conditions;
            TriggerFuncData[] conditionsR = mData.conditions;
            int conditionsLen             = conditionsT.Length;
            for (int conditionsI = 0; conditionsI < conditionsLen; ++conditionsI)
            {
                TriggerFuncData conditionsU = conditionsT[conditionsI];
                TriggerFuncData conditionsV = conditionsR[conditionsI];
                if (conditionsV != null)
                {
                    if (conditionsU == null)
                    {
                        return(false);
                    }
                    if (!conditionsU.dataEquals(conditionsV))
                    {
                        return(false);
                    }
                }
                else
                {
                    if (conditionsU != null)
                    {
                        return(false);
                    }
                }
            }
        }
        else
        {
            if (this.conditions != null)
            {
                return(false);
            }
        }

        if (mData.actions != null)
        {
            if (this.actions == null)
            {
                return(false);
            }
            if (this.actions.Length != mData.actions.Length)
            {
                return(false);
            }
            TriggerFuncData[] actionsT = this.actions;
            TriggerFuncData[] actionsR = mData.actions;
            int actionsLen             = actionsT.Length;
            for (int actionsI = 0; actionsI < actionsLen; ++actionsI)
            {
                TriggerFuncData actionsU = actionsT[actionsI];
                TriggerFuncData actionsV = actionsR[actionsI];
                if (actionsV != null)
                {
                    if (actionsU == null)
                    {
                        return(false);
                    }
                    if (!actionsU.dataEquals(actionsV))
                    {
                        return(false);
                    }
                }
                else
                {
                    if (actionsU != null)
                    {
                        return(false);
                    }
                }
            }
        }
        else
        {
            if (this.actions != null)
            {
                return(false);
            }
        }

        return(true);
    }