Beispiel #1
0
            public TtabItemMotiveGroupArrayList Clone(TtabItemMotiveTable parent)
            {
                TtabItemMotiveGroupArrayList clone = new TtabItemMotiveGroupArrayList();

                foreach (TtabItemMotiveGroup item in this)
                {
                    clone.Add(item.Clone(parent));
                }
                return(clone);
            }
Beispiel #2
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);
            }
        }
Beispiel #3
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);
            }
        }