public override TtabItemMotiveItem Clone(TtabItemMotiveGroup parent) { TtabItemSingleMotiveItem clone = new TtabItemSingleMotiveItem(parent); this.CopyTo(clone, false); return(clone); }
public TtabItemMotiveGroup Clone(TtabItemMotiveTable parent) { TtabItemMotiveGroup clone = new TtabItemMotiveGroup(parent, count, type); this.CopyTo(clone); return(clone); }
/// <summary> /// Creates a deep copy of the TtabItemMotiveItemArrayList /// </summary> public TtabItemMotiveItemArrayList Clone(TtabItemMotiveGroup parent) { TtabItemMotiveItemArrayList clone = new TtabItemMotiveItemArrayList(); foreach (TtabItemMotiveItem item in this) { clone.Add(item.Clone(parent)); } return(clone); }
public int Add(TtabItemMotiveGroup item) { //if (items.Count >= 0x08) // we don't really know... //return -1; item.Parent = this; int result = items.Add(item); if (result >= 0 && Wrapper != null) { Wrapper.OnWrapperChanged(this, new EventArgs()); } return(result); }
private void Unserialize(System.IO.BinaryReader reader) { int nrGroups = 0; if (counts != null) { nrGroups = counts.Length; } else { nrGroups = reader.ReadInt32(); } if (items.Capacity < nrGroups) { items = new TtabItemMotiveGroupArrayList(new TtabItemMotiveGroup[nrGroups]); } for (int i = 0; i < nrGroups; i++) { items[i] = new TtabItemMotiveGroup(this, counts != null ? counts[i] : 0, type, reader); } }
public TtabItemMotiveTable(TtabItem parent, int[] counts, TtabItemMotiveTableType type) { this.parent = parent; this.counts = counts; this.type = type; int nrGroups = 0; if (counts != null) { nrGroups = counts.Length; } else { nrGroups = type == TtabItemMotiveTableType.Human ? 5 : 8; } items = new TtabItemMotiveGroupArrayList(new TtabItemMotiveGroup[nrGroups]); for (int i = 0; i < nrGroups; i++) { items[i] = new TtabItemMotiveGroup(this, counts != null ? counts[i] : -1, type); } }
public void Remove(TtabItemMotiveGroup item) { this.RemoveAt(items.IndexOf(item)); }
public TtabItemSingleMotiveItem(TtabItemMotiveGroup parent, System.IO.BinaryReader reader) : base(parent, reader) { }
public TtabItemSingleMotiveItem(TtabItemMotiveGroup parent) : base(parent) { }
// All covered by ICollection #endregion public TtabItemAnimalMotiveItem(TtabItemMotiveGroup parent) : base(parent) { }
public abstract TtabItemMotiveItem Clone(TtabItemMotiveGroup parent);
public TtabItemMotiveItem(TtabItemMotiveGroup parent, System.IO.BinaryReader reader) : this(parent) { Unserialize(reader); }
public TtabItemMotiveItem(TtabItemMotiveGroup parent) { this.parent = parent; }
private void CopyTo(TtabItemMotiveGroup target) { target.items = items == null ? null : items.Clone(target); }