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

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

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

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