Пример #1
0
    /// <summary>
    /// 转文本输出
    /// </summary>
    protected override void toWriteDataString(DataWriter writer)
    {
        writer.writeTabs();
        writer.sb.Append("runningDatas");
        writer.sb.Append(':');
        writer.sb.Append("Map<int,AchievementData>");
        if (this.runningDatas != null)
        {
            writer.sb.Append('(');
            writer.sb.Append(this.runningDatas.size());
            writer.sb.Append(')');
            writer.writeEnter();
            writer.writeLeftBrace();
            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];
                        writer.writeTabs();
                        writer.sb.Append(runningDatasK);

                        writer.sb.Append(':');
                        if (runningDatasV != null)
                        {
                            runningDatasV.writeDataString(writer);
                        }
                        else
                        {
                            writer.sb.Append("AchievementData=null");
                        }

                        writer.writeEnter();
                    }
                }
            }
            writer.writeRightBrace();
        }
        else
        {
            writer.sb.Append("=null");
        }

        writer.writeEnter();
        writer.writeTabs();
        writer.sb.Append("completeDatas");
        writer.sb.Append(':');
        writer.sb.Append("Map<int,AchievementCompleteData>");
        if (this.completeDatas != null)
        {
            writer.sb.Append('(');
            writer.sb.Append(this.completeDatas.size());
            writer.sb.Append(')');
            writer.writeEnter();
            writer.writeLeftBrace();
            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];
                        writer.writeTabs();
                        writer.sb.Append(completeDatasK);

                        writer.sb.Append(':');
                        if (completeDatasV != null)
                        {
                            completeDatasV.writeDataString(writer);
                        }
                        else
                        {
                            writer.sb.Append("AchievementCompleteData=null");
                        }

                        writer.writeEnter();
                    }
                }
            }
            writer.writeRightBrace();
        }
        else
        {
            writer.sb.Append("=null");
        }

        writer.writeEnter();
    }