using System.Collections.Generic; using System.Linq; using ACE.Entity.Models; namespace ACE.Entity { public class ObjDesc { public uint PaletteID { get; set; } public List SubPalettes { get; set; } = new List(); public List TextureChanges { get; set; } = new List(); public List AnimPartChanges { get; set; } = new List(); /// /// Helper function to ensure we don't add redundant parts to the list /// 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); } /// /// Helper function to ensure we only have one AnimationPartChange.PartId in the list /// public void AddAnimPartChange(PropertiesAnimPart ap) { var p = AnimPartChanges.FirstOrDefault(c => c.Index == ap.Index && c.AnimationId == ap.AnimationId); if (p != null) AnimPartChanges.Remove(p); AnimPartChanges.Add(ap); } } }