Ejemplo n.º 1
0
        public override TtabItemMotiveItem Clone(TtabItemMotiveGroup parent)
        {
            TtabItemSingleMotiveItem clone = new TtabItemSingleMotiveItem(parent);

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

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

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