Example #1
0
        public override TtabItemMotiveItem Clone(TtabItemMotiveGroup parent)
        {
            TtabItemSingleMotiveItem clone = new TtabItemSingleMotiveItem(parent);

            this.CopyTo(clone, false);
            return(clone);
        }
Example #2
0
        public TtabItemMotiveGroup Clone(TtabItemMotiveTable parent)
        {
            TtabItemMotiveGroup clone = new TtabItemMotiveGroup(parent, count, type);

            this.CopyTo(clone);
            return(clone);
        }
Example #3
0
            /// <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);
            }
Example #4
0
        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);
        }
Example #5
0
        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);
            }
        }
Example #6
0
        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);
            }
        }
Example #7
0
 public void Remove(TtabItemMotiveGroup item)
 {
     this.RemoveAt(items.IndexOf(item));
 }
Example #8
0
 public TtabItemSingleMotiveItem(TtabItemMotiveGroup parent, System.IO.BinaryReader reader) : base(parent, reader)
 {
 }
Example #9
0
 public TtabItemSingleMotiveItem(TtabItemMotiveGroup parent) : base(parent)
 {
 }
Example #10
0
        // All covered by ICollection
        #endregion

        public TtabItemAnimalMotiveItem(TtabItemMotiveGroup parent) : base(parent)
        {
        }
Example #11
0
 public abstract TtabItemMotiveItem Clone(TtabItemMotiveGroup parent);
Example #12
0
 public TtabItemMotiveItem(TtabItemMotiveGroup parent, System.IO.BinaryReader reader)
     : this(parent) { Unserialize(reader); }
Example #13
0
 public TtabItemMotiveItem(TtabItemMotiveGroup parent)
 {
     this.parent = parent;
 }
Example #14
0
 private void CopyTo(TtabItemMotiveGroup target)
 {
     target.items = items == null ? null : items.Clone(target);
 }