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

        FriendPartData mData = (FriendPartData)data;

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

            LongObjectMap <FriendData> friendsT = this.friends;
            if (!mData.friends.isEmpty())
            {
                FriendData[] friendsVValues = mData.friends.getValues();
                for (int friendsVI = friendsVValues.Length - 1; friendsVI >= 0; --friendsVI)
                {
                    FriendData friendsV = friendsVValues[friendsVI];
                    if (friendsV != null)
                    {
                        FriendData friendsU;
                        if (friendsV != null)
                        {
                            friendsU = (FriendData)friendsV.clone();
                        }
                        else
                        {
                            friendsU = null;
                            nullObjError("friendsU");
                        }

                        friendsT.put(friendsU.playerID, friendsU);
                    }
                }
            }
        }
        else
        {
            this.friends = null;
            nullObjError("friends");
        }

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

            LongObjectMap <ContactData> blackListT = this.blackList;
            if (!mData.blackList.isEmpty())
            {
                ContactData[] blackListVValues = mData.blackList.getValues();
                for (int blackListVI = blackListVValues.Length - 1; blackListVI >= 0; --blackListVI)
                {
                    ContactData blackListV = blackListVValues[blackListVI];
                    if (blackListV != null)
                    {
                        ContactData blackListU;
                        if (blackListV != null)
                        {
                            blackListU = (ContactData)blackListV.clone();
                        }
                        else
                        {
                            blackListU = null;
                            nullObjError("blackListU");
                        }

                        blackListT.put(blackListU.playerID, blackListU);
                    }
                }
            }
        }
        else
        {
            this.blackList = null;
            nullObjError("blackList");
        }

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

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

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