public SaveFile(Stream s) { MainHeader = s.ReadStruct<SaveGameMainHeader>(); while (s.Position < s.Length) { long sectionStart = s.Position; Section section = new Section(s); if (section.Size == 0 && section.Version == 0) break; Console.WriteLine("Got {0} ({4:X2}) at {3:X4}. Version {1:X2}, {2:X4} bytes.", section.SectionId, section.Version, section.Size, sectionStart, (uint)section.SectionId); Sections.Add(section.SectionId, section); } Player = new PlayerSection(Sections[SectionId.GSSI_PLAYER]); }
public PlayerSection(Section section) { _Section = section; _SavedPlayerData = _Section.Data.ReadStruct<SavedPlayerData>(0); }