Esempio n. 1
0
    public void Serialize(DataStream writer)
    {
        writer.WriteString8(StoryName);
        writer.WriteSInt32(Chapters.Count);
        foreach (KeyValuePair <int, Chapter> kv in Chapters)
        {
            kv.Value.Serialize(writer);
        }

        writer.WriteSInt32(Base_CardLimitDict.Count);
        foreach (KeyValuePair <int, int> kv in Base_CardLimitDict)
        {
            writer.WriteSInt32(kv.Key);
            writer.WriteSInt32(kv.Value);
        }

        writer.WriteSInt32(CardUnlockInfos.Count);
        foreach (KeyValuePair <int, bool> kv in CardUnlockInfos)
        {
            writer.WriteSInt32(kv.Key);
            writer.WriteByte((byte)(kv.Value ? 0x01 : 0x00));
        }

        writer.WriteSInt32(PlayerBuildInfos.Count);
        foreach (BuildInfo bi in PlayerBuildInfos.Values)
        {
            bi.Serialize(writer);
        }

        StoryGamePlaySettings.Serialize(writer);
        writer.WriteSInt32(CurrentFightingChapterID);
        writer.WriteSInt32(Crystal);
    }
    public override void Serialize(DataStream writer)
    {
        base.Serialize(writer);
        writer.WriteSInt32(OnlineBuildInfos.Count);
        foreach (BuildInfo buildInfo in OnlineBuildInfos.Values)
        {
            buildInfo.Serialize(writer);
        }

        OnlineGamePlaySettings.Serialize(writer);

        writer.WriteByte((byte)(HasStory ? 0x01 : 0x00));

        if (HasStory)
        {
            Story.Serialize(writer);
        }
    }