Exemple #1
0
        public Villager(ISaveFile saveFile, int idx)
        {
            SaveFile = saveFile;
            Index    = idx;

            var offsets = MainOffsets.GetOffsets(SaveFile.GetRevision());

            Offset = offsets.Offset_Vilagers + idx * offsets.Villager_Size;

            Species     = SaveFile.ReadU8(Offset + offsets.Villager_Species);
            VariantIdx  = SaveFile.ReadU8(Offset + offsets.Villager_Variant);
            Personality = SaveFile.ReadU8(Offset + offsets.Villager_Personality);
            Catchphrase = SaveFile.ReadString(Offset + offsets.Villager_Catchphrase, offsets.Villager_CatchphraseLength); // Not sure about the size.

            var ftr = new Item[offsets.Villager_FurnitureCount];

            for (var i = 0; i < ftr.Length; i++)
            {
                ftr[i] = new Item(SaveFile, Offset + offsets.Villager_Furniture + i * 0x2C);
            }
            Furniture = new ItemCollection(ftr);

            Wallpaper = new ItemCollection(new Item[1] {
                new Item(SaveFile, Offset + offsets.Villager_Wallpaper)
            });
            Flooring = new ItemCollection(new Item[1] {
                new Item(SaveFile, Offset + offsets.Villager_Flooring)
            });
        }
Exemple #2
0
        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);
        }