public override void Deserialize(DataStream reader) { base.Deserialize(reader); int count = reader.ReadSInt32(); OnlineBuildInfos = new SortedDictionary <int, BuildInfo>(); for (int i = 0; i < count; i++) { BuildInfo bi = BuildInfo.Deserialize(reader); OnlineBuildInfos.Add(bi.BuildID, bi); } OnlineGamePlaySettings = GamePlaySettings.Deserialize(reader); HasStory = reader.ReadByte() == 0x01; if (HasStory) { Story = Story.Deserialize(reader); } }
public static Story Deserialize(DataStream reader) { Story newStory = new Story(); newStory.StoryName = reader.ReadString8(); int chapterCount = reader.ReadSInt32(); newStory.Chapters = new SortedDictionary <int, Chapter>(); for (int i = 0; i < chapterCount; i++) { Chapter chapter = Chapter.Deserialize(reader); if (newStory.Chapters.ContainsKey(chapter.ChapterID)) { Utils.DebugLog("Duplicate! chapter.ChapterID: " + chapter.ChapterID); } else { newStory.Chapters.Add(chapter.ChapterID, chapter); } } int cldCount = reader.ReadSInt32(); newStory.Base_CardLimitDict = new SortedDictionary <int, int>(); for (int i = 0; i < cldCount; i++) { int key = reader.ReadSInt32(); int value = reader.ReadSInt32(); if (newStory.Base_CardLimitDict.ContainsKey(key)) { Utils.DebugLog("Duplicate! Base_CardLimitDict.key: " + key); } else { newStory.Base_CardLimitDict.Add(key, value); } } int cardUnlockInfoCount = reader.ReadSInt32(); SortedDictionary <int, bool> cardUnlockInfos = new SortedDictionary <int, bool>(); for (int i = 0; i < cardUnlockInfoCount; i++) { int cardID = reader.ReadSInt32(); bool unlock = reader.ReadByte() == 0x01; cardUnlockInfos.Add(cardID, unlock); } newStory.CardUnlockInfos = cardUnlockInfos; int buildCount = reader.ReadSInt32(); newStory.PlayerBuildInfos = new SortedDictionary <int, BuildInfo>(); for (int i = 0; i < buildCount; i++) { BuildInfo bi = BuildInfo.Deserialize(reader); if (newStory.PlayerBuildInfos.ContainsKey(bi.BuildID)) { Utils.DebugLog("Duplicate! bi.BuildID: " + bi.BuildID); } else { newStory.PlayerBuildInfos.Add(bi.BuildID, bi); } } newStory.StoryGamePlaySettings = GamePlaySettings.Deserialize(reader); newStory.CurrentFightingChapterID = reader.ReadSInt32(); newStory.Crystal = reader.ReadSInt32(); return(newStory); }