示例#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)
            });
        }
示例#2
0
 public Item(ISaveFile save, int offset)
     : this(save.ReadU16(offset + 0), save.ReadU8(offset + 2), save.ReadU8(offset + 3),
            save.ReadU16(offset + 4), save.ReadU16(offset + 6))
 {
 }
 public EncryptedInt32(ISaveFile save, int offset)
     : this(save.ReadU32(offset), save.ReadU16(offset + 4),
            save.ReadU8(offset + 6), save.ReadU8(offset + 7))
 {
 }