/// <summary> /// Helper function to ensure we don't add redundant parts to the list /// </summary> public void AddTextureChange(PropertiesTextureMap tm) { var e = TextureChanges.FirstOrDefault(c => c.PartIndex == tm.PartIndex && c.OldTexture == tm.OldTexture && c.NewTexture == tm.NewTexture); if (e == null) { TextureChanges.Add(tm); } }
public void Unpack(BinaryReader reader) { reader.AlignBoundary(); reader.ReadByte(); // ObjDesc always starts with 11. var numPalettes = reader.ReadByte(); var numTextureMapChanges = reader.ReadByte(); var numAnimPartChanges = reader.ReadByte(); if (numPalettes > 0) { PaletteID = reader.ReadAsDataIDOfKnownType(0x04000000); } SubPalettes.Unpack(reader, numPalettes); TextureChanges.Unpack(reader, numTextureMapChanges); AnimPartChanges.Unpack(reader, numAnimPartChanges); reader.AlignBoundary(); }