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
        private void Unserialize(System.IO.BinaryReader reader)
        {
            int nrItems = Wrapper.Format < 0x54 ? count : reader.ReadInt32();

            if (type == TtabItemMotiveTableType.Human)
            {
                for (int i = 0; i < nrItems; i++)
                {
                    items[i] = new TtabItemSingleMotiveItem(this, reader);
                }
                for (int i = nrItems; i < items.Count; i++)
                {
                    items[i] = new TtabItemSingleMotiveItem(this);
                }
            }
            else
            {
                for (int i = 0; i < nrItems; i++)
                {
                    items[i] = new TtabItemAnimalMotiveItem(this, reader);
                }
                for (int i = nrItems; i < items.Count; i++)
                {
                    items[i] = new TtabItemAnimalMotiveItem(this);
                }
            }
        }
Ejemplo n.º 3
0
        protected override void Unserialize(System.IO.BinaryReader reader)
        {
            int count = reader.ReadInt32();

            items = new TtabItemSingleMotiveItemArrayList(new TtabItemSingleMotiveItem[count]);
            for (int i = 0; i < count; i++)
            {
                items[i] = new TtabItemSingleMotiveItem(this.parent, reader);
            }
        }
Ejemplo n.º 4
0
 public void Clear()
 {
     for (int i = 0; i < items.Count; i++)
     {
         items[i] = new TtabItemSingleMotiveItem(parent);
     }
     if (Wrapper != null)
     {
         Wrapper.OnWrapperChanged(this, new EventArgs());
     }
 }
Ejemplo n.º 5
0
        public int Add(TtabItemSingleMotiveItem item)
        {
            item.Parent = this.parent;
            int result = items.Add(item);

            if (result >= 0 && Wrapper != null)
            {
                Wrapper.OnWrapperChanged(this, new EventArgs());
            }
            return(result);
        }
Ejemplo n.º 6
0
        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);
                }
            }
        }
Ejemplo n.º 7
0
 public bool Contains(TtabItemSingleMotiveItem item)
 {
     return(items.Contains(item));
 }
Ejemplo n.º 8
0
 public void Remove(TtabItemSingleMotiveItem item)
 {
     this.RemoveAt(items.IndexOf(item));
 }