コード例 #1
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        AchievementPartData mData = (AchievementPartData)data;

        if (mData.runningDatas != null)
        {
            if (this.runningDatas == null)
            {
                return(false);
            }
            if (this.runningDatas.size() != mData.runningDatas.size())
            {
                return(false);
            }
            IntObjectMap <AchievementData> runningDatasR = mData.runningDatas;
            if (!this.runningDatas.isEmpty())
            {
                int               runningDatasKFreeValue = this.runningDatas.getFreeValue();
                int[]             runningDatasKKeys      = this.runningDatas.getKeys();
                AchievementData[] runningDatasVValues    = this.runningDatas.getValues();
                for (int runningDatasKI = runningDatasKKeys.Length - 1; runningDatasKI >= 0; --runningDatasKI)
                {
                    int runningDatasK = runningDatasKKeys[runningDatasKI];
                    if (runningDatasK != runningDatasKFreeValue)
                    {
                        AchievementData runningDatasV = runningDatasVValues[runningDatasKI];
                        AchievementData runningDatasU = runningDatasR.get(runningDatasK);
                        if (runningDatasU != null)
                        {
                            if (runningDatasV == null)
                            {
                                return(false);
                            }
                            if (!runningDatasV.dataEquals(runningDatasU))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            if (runningDatasV != null)
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (this.runningDatas != null)
            {
                return(false);
            }
        }

        if (mData.completeDatas != null)
        {
            if (this.completeDatas == null)
            {
                return(false);
            }
            if (this.completeDatas.size() != mData.completeDatas.size())
            {
                return(false);
            }
            IntObjectMap <AchievementCompleteData> completeDatasR = mData.completeDatas;
            if (!this.completeDatas.isEmpty())
            {
                int   completeDatasKFreeValue = this.completeDatas.getFreeValue();
                int[] completeDatasKKeys      = this.completeDatas.getKeys();
                AchievementCompleteData[] completeDatasVValues = this.completeDatas.getValues();
                for (int completeDatasKI = completeDatasKKeys.Length - 1; completeDatasKI >= 0; --completeDatasKI)
                {
                    int completeDatasK = completeDatasKKeys[completeDatasKI];
                    if (completeDatasK != completeDatasKFreeValue)
                    {
                        AchievementCompleteData completeDatasV = completeDatasVValues[completeDatasKI];
                        AchievementCompleteData completeDatasU = completeDatasR.get(completeDatasK);
                        if (completeDatasU != null)
                        {
                            if (completeDatasV == null)
                            {
                                return(false);
                            }
                            if (!completeDatasV.dataEquals(completeDatasU))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            if (completeDatasV != null)
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (this.completeDatas != null)
            {
                return(false);
            }
        }

        return(true);
    }