public Building(ISaveFile saveFile, int index) { var offsets = MainOffsets.GetOffsets(saveFile.GetRevision()); if (index >= offsets.Building_Count) { throw new IndexOutOfRangeException("Index was greater than the number of building slots!"); } this = saveFile.ReadStruct <Building>(offsets.Offset_Buildings + index * 0x14); }
public DesignPattern(ISaveFile saveFile, int idx) { SaveFile = saveFile; Index = idx; var offsets = MainOffsets.GetOffsets(SaveFile.GetRevision()); Offset = offsets.Offset_Patterns + idx * offsets.Pattern_Size; Name = SaveFile.ReadString(Offset + offsets.Pattern_Name, 20); PersonalID = SaveFile.ReadStruct <PersonalID>(Offset + offsets.Pattern_PersonalID); for (int i = 0; i < 15; i++) { Palette[i] = new DesignColor(saveFile, Offset + offsets.Pattern_Palette + i * 3); } Pixels = SaveFile.ReadArray <byte>(Offset + offsets.Pattern_ImageData, Pixels.Length); }
public DesignColor(ISaveFile saveFile, int offset) { this = saveFile.ReadStruct <DesignColor>(offset); }
public StalkMarket(ISaveFile saveFile) { var offsets = MainOffsets.GetOffsets(saveFile.GetRevision()); this = saveFile.ReadStruct <StalkMarket>(offsets.Offset_Turnips); }