Ejemplo n.º 1
0
    /// <summary>
    /// 复制(潜拷贝)
    /// </summary>
    protected override void toShadowCopy(BaseData data)
    {
        base.toShadowCopy(data);

        if (!(data is PlayerRoleGroupToolData))
        {
            return;
        }

        PlayerRoleGroupToolData mData = (PlayerRoleGroupToolData)data;

        this.groups            = mData.groups;
        this.operateNum        = mData.operateNum;
        this.applyDic          = mData.applyDic;
        this.canInviteInAbs    = mData.canInviteInAbs;
        this.createOperateNums = mData.createOperateNums;
        this.inviteList        = mData.inviteList;
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        if (!base.toDataEquals(data))
        {
            return(false);
        }

        PlayerRoleGroupToolData mData = (PlayerRoleGroupToolData)data;

        if (mData.groups != null)
        {
            if (this.groups == null)
            {
                return(false);
            }
            if (this.groups.size() != mData.groups.size())
            {
                return(false);
            }
            LongObjectMap <PlayerRoleGroupSaveData> groupsR = mData.groups;
            if (!this.groups.isEmpty())
            {
                long   groupsKFreeValue = this.groups.getFreeValue();
                long[] groupsKKeys      = this.groups.getKeys();
                PlayerRoleGroupSaveData[] groupsVValues = this.groups.getValues();
                for (int groupsKI = groupsKKeys.Length - 1; groupsKI >= 0; --groupsKI)
                {
                    long groupsK = groupsKKeys[groupsKI];
                    if (groupsK != groupsKFreeValue)
                    {
                        PlayerRoleGroupSaveData groupsV = groupsVValues[groupsKI];
                        PlayerRoleGroupSaveData groupsU = groupsR.get(groupsK);
                        if (groupsU != null)
                        {
                            if (groupsV == null)
                            {
                                return(false);
                            }
                            if (!groupsV.dataEquals(groupsU))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            if (groupsV != null)
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (this.groups != null)
            {
                return(false);
            }
        }

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

        if (mData.applyDic != null)
        {
            if (this.applyDic == null)
            {
                return(false);
            }
            if (this.applyDic.size() != mData.applyDic.size())
            {
                return(false);
            }
            LongObjectMap <PlayerApplyRoleGroupSelfData> applyDicR = mData.applyDic;
            if (!this.applyDic.isEmpty())
            {
                long   applyDicKFreeValue = this.applyDic.getFreeValue();
                long[] applyDicKKeys      = this.applyDic.getKeys();
                PlayerApplyRoleGroupSelfData[] applyDicVValues = this.applyDic.getValues();
                for (int applyDicKI = applyDicKKeys.Length - 1; applyDicKI >= 0; --applyDicKI)
                {
                    long applyDicK = applyDicKKeys[applyDicKI];
                    if (applyDicK != applyDicKFreeValue)
                    {
                        PlayerApplyRoleGroupSelfData applyDicV = applyDicVValues[applyDicKI];
                        PlayerApplyRoleGroupSelfData applyDicU = applyDicR.get(applyDicK);
                        if (applyDicU != null)
                        {
                            if (applyDicV == null)
                            {
                                return(false);
                            }
                            if (!applyDicV.dataEquals(applyDicU))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            if (applyDicV != null)
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (this.applyDic != null)
            {
                return(false);
            }
        }

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

        if (mData.createOperateNums != null)
        {
            if (this.createOperateNums == null)
            {
                return(false);
            }
            if (this.createOperateNums.size() != mData.createOperateNums.size())
            {
                return(false);
            }
            LongQueue createOperateNumsT   = this.createOperateNums;
            LongQueue createOperateNumsR   = mData.createOperateNums;
            int       createOperateNumsLen = createOperateNumsT.size();
            for (int createOperateNumsI = 0; createOperateNumsI < createOperateNumsLen; ++createOperateNumsI)
            {
                long createOperateNumsU = createOperateNumsT.get(createOperateNumsI);
                long createOperateNumsV = createOperateNumsR.get(createOperateNumsI);
                if (createOperateNumsU != createOperateNumsV)
                {
                    return(false);
                }
            }
        }
        else
        {
            if (this.createOperateNums != null)
            {
                return(false);
            }
        }

        if (mData.inviteList != null)
        {
            if (this.inviteList == null)
            {
                return(false);
            }
            if (this.inviteList.size() != mData.inviteList.size())
            {
                return(false);
            }
            SList <InviteRoleGroupReceiveData> inviteListT = this.inviteList;
            SList <InviteRoleGroupReceiveData> inviteListR = mData.inviteList;
            int inviteListLen = inviteListT.size();
            for (int inviteListI = 0; inviteListI < inviteListLen; ++inviteListI)
            {
                InviteRoleGroupReceiveData inviteListU = inviteListT.get(inviteListI);
                InviteRoleGroupReceiveData inviteListV = inviteListR.get(inviteListI);
                if (inviteListV != null)
                {
                    if (inviteListU == null)
                    {
                        return(false);
                    }
                    if (!inviteListU.dataEquals(inviteListV))
                    {
                        return(false);
                    }
                }
                else
                {
                    if (inviteListU != null)
                    {
                        return(false);
                    }
                }
            }
        }
        else
        {
            if (this.inviteList != null)
            {
                return(false);
            }
        }

        return(true);
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 复制(深拷贝)
    /// </summary>
    protected override void toCopy(BaseData data)
    {
        base.toCopy(data);

        if (!(data is PlayerRoleGroupToolData))
        {
            return;
        }

        PlayerRoleGroupToolData mData = (PlayerRoleGroupToolData)data;

        if (mData.groups != null)
        {
            if (this.groups != null)
            {
                this.groups.clear();
                this.groups.ensureCapacity(mData.groups.size());
            }
            else
            {
                this.groups = new LongObjectMap <PlayerRoleGroupSaveData>(mData.groups.size());
            }

            LongObjectMap <PlayerRoleGroupSaveData> groupsT = this.groups;
            if (!mData.groups.isEmpty())
            {
                PlayerRoleGroupSaveData[] groupsVValues = mData.groups.getValues();
                for (int groupsVI = groupsVValues.Length - 1; groupsVI >= 0; --groupsVI)
                {
                    PlayerRoleGroupSaveData groupsV = groupsVValues[groupsVI];
                    if (groupsV != null)
                    {
                        PlayerRoleGroupSaveData groupsU;
                        if (groupsV != null)
                        {
                            groupsU = (PlayerRoleGroupSaveData)groupsV.clone();
                        }
                        else
                        {
                            groupsU = null;
                            nullObjError("groupsU");
                        }

                        groupsT.put(groupsU.groupID, groupsU);
                    }
                }
            }
        }
        else
        {
            this.groups = null;
            nullObjError("groups");
        }

        this.operateNum = mData.operateNum;

        if (mData.applyDic != null)
        {
            if (this.applyDic != null)
            {
                this.applyDic.clear();
                this.applyDic.ensureCapacity(mData.applyDic.size());
            }
            else
            {
                this.applyDic = new LongObjectMap <PlayerApplyRoleGroupSelfData>(mData.applyDic.size());
            }

            LongObjectMap <PlayerApplyRoleGroupSelfData> applyDicT = this.applyDic;
            if (!mData.applyDic.isEmpty())
            {
                PlayerApplyRoleGroupSelfData[] applyDicVValues = mData.applyDic.getValues();
                for (int applyDicVI = applyDicVValues.Length - 1; applyDicVI >= 0; --applyDicVI)
                {
                    PlayerApplyRoleGroupSelfData applyDicV = applyDicVValues[applyDicVI];
                    if (applyDicV != null)
                    {
                        PlayerApplyRoleGroupSelfData applyDicU;
                        if (applyDicV != null)
                        {
                            applyDicU = (PlayerApplyRoleGroupSelfData)applyDicV.clone();
                        }
                        else
                        {
                            applyDicU = null;
                            nullObjError("applyDicU");
                        }

                        applyDicT.put(applyDicU.data.groupID, applyDicU);
                    }
                }
            }
        }
        else
        {
            this.applyDic = null;
            nullObjError("applyDic");
        }

        this.canInviteInAbs = mData.canInviteInAbs;

        if (mData.createOperateNums != null)
        {
            if (this.createOperateNums != null)
            {
                this.createOperateNums.clear();
                this.createOperateNums.ensureCapacity(mData.createOperateNums.size());
            }
            else
            {
                this.createOperateNums = new LongQueue();
            }

            LongQueue createOperateNumsT = this.createOperateNums;
            if (!mData.createOperateNums.isEmpty())
            {
                long[] createOperateNumsVValues = mData.createOperateNums.getValues();
                int    createOperateNumsVMark   = mData.createOperateNums.getMark();
                int    createOperateNumsVStart  = mData.createOperateNums.getStart();
                for (int createOperateNumsVI = 0, createOperateNumsVLen = mData.createOperateNums.length(); createOperateNumsVI < createOperateNumsVLen; ++createOperateNumsVI)
                {
                    long createOperateNumsV = createOperateNumsVValues[(createOperateNumsVI + createOperateNumsVStart) & createOperateNumsVMark];
                    long createOperateNumsU;
                    createOperateNumsU = createOperateNumsV;

                    createOperateNumsT.offer(createOperateNumsU);
                }
            }
        }
        else
        {
            this.createOperateNums = null;
            nullObjError("createOperateNums");
        }

        if (mData.inviteList != null)
        {
            if (this.inviteList != null)
            {
                this.inviteList.clear();
                this.inviteList.ensureCapacity(mData.inviteList.size());
            }
            else
            {
                this.inviteList = new SList <InviteRoleGroupReceiveData>();
            }

            SList <InviteRoleGroupReceiveData> inviteListT = this.inviteList;
            if (!mData.inviteList.isEmpty())
            {
                InviteRoleGroupReceiveData[] inviteListVValues = mData.inviteList.getValues();
                for (int inviteListVI = 0, inviteListVLen = mData.inviteList.length(); inviteListVI < inviteListVLen; ++inviteListVI)
                {
                    InviteRoleGroupReceiveData inviteListV = inviteListVValues[inviteListVI];
                    InviteRoleGroupReceiveData inviteListU;
                    if (inviteListV != null)
                    {
                        inviteListU = (InviteRoleGroupReceiveData)inviteListV.clone();
                    }
                    else
                    {
                        inviteListU = null;
                        nullObjError("inviteListU");
                    }

                    inviteListT.add(inviteListU);
                }
            }
        }
        else
        {
            this.inviteList = null;
            nullObjError("inviteList");
        }
    }