public TtabItemMotiveGroup Clone(TtabItemMotiveTable parent) { TtabItemMotiveGroup clone = new TtabItemMotiveGroup(parent, count, type); this.CopyTo(clone); return(clone); }
private TtabItemMotiveTable Clone(TtabItem parent) { TtabItemMotiveTable clone = new TtabItemMotiveTable(parent, counts, type); this.CopyTo(clone); return(clone); }
public TtabItemMotiveGroupArrayList Clone(TtabItemMotiveTable parent) { TtabItemMotiveGroupArrayList clone = new TtabItemMotiveGroupArrayList(); foreach (TtabItemMotiveGroup item in this) { clone.Add(item.Clone(parent)); } return(clone); }
/// <summary> /// Reads Data from the Stream /// </summary> /// <param name="reader"></param> private void Unserialize(System.IO.BinaryReader reader) { action = reader.ReadUInt16(); guard = reader.ReadUInt16(); if (counts != null) { for (int i = 0; i < counts.Length; i++) { counts[i] = reader.ReadInt32(); } } flags = reader.ReadUInt16(); flags2 = reader.ReadUInt16(); strindex = reader.ReadUInt32(); attenuationcode = reader.ReadUInt32(); attenuationvalue = reader.ReadSingle(); //float autonomy = reader.ReadUInt32(); joinindex = reader.ReadUInt32(); uidisplaytype = 0; facialanimation = 0; memoryitermult = 0f; objecttype = 0; modeltableid = 0; if (parent.Format >= 0x45) { uidisplaytype = reader.ReadUInt16(); if (parent.Format >= 0x46) { if (parent.Format >= 0x4a) { facialanimation = reader.ReadUInt32(); if (parent.Format >= 0x4c) { memoryitermult = reader.ReadSingle(); //float objecttype = reader.ReadUInt32(); } } modeltableid = reader.ReadUInt32(); } } humanGroups = new TtabItemMotiveTable(this, counts, TtabItemMotiveTableType.Human, reader); if (parent.Format >= 0x54) { animalGroups = new TtabItemMotiveTable(this, null, TtabItemMotiveTableType.Animal, reader); } }
public void CopyTo(TtabItemMotiveTable target) { if (target == null) { return; } for (int i = 0; i < target.items.Count && i < this.items.Count; i++) { target.items[i] = this.items[i].Clone(); } for (int i = this.items.Count; i < target.items.Count; i++) { target.items[i] = this.items[0].Clone(); } }
public TtabItem(Ttab parent) { this.parent = parent; if (parent.Format < 0x44) { counts = new int[] { 0x10 } } ; else if (parent.Format < 0x54) { counts = new int[] { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, } } ; humanGroups = new TtabItemMotiveTable(this, counts, TtabItemMotiveTableType.Human); animalGroups = new TtabItemMotiveTable(this, null, TtabItemMotiveTableType.Animal); }
public TtabItemMotiveGroup(TtabItemMotiveTable parent, int count, TtabItemMotiveTableType type) { this.parent = parent; this.count = count; this.type = type; int nrItems = count != -1 ? count : 16; items = new TtabItemMotiveItemArrayList(new TtabItemMotiveItem[nrItems < 16 ? 16 : nrItems]); if (type == TtabItemMotiveTableType.Human) { for (int i = 0; i < nrItems; i++) { items[i] = new TtabItemSingleMotiveItem(this); } } else { for (int i = 0; i < nrItems; i++) { items[i] = new TtabItemAnimalMotiveItem(this); } } }
public TtabItemMotiveGroup(TtabItemMotiveTable parent, int count, TtabItemMotiveTableType type, System.IO.BinaryReader reader) : this(parent, count, type) { Unserialize(reader); }