コード例 #1
0
        public GhostPoint2DCollection(GhostPoint2D[] ghostPoints, int capacity)
        {
            Capacity = capacity;
            CurrentCount = ghostPoints.Length;
            if (Capacity < CurrentCount)
            {
                throw (new CollectionCapacityException());
            }

            GhostPoints = ghostPoints;
        }
コード例 #2
0
        public void Union(GhostPoint2DCollection ghostPoint2DCollection)
        {
            Capacity += ghostPoint2DCollection.Capacity;

            GhostPoint2D[] ghostPoints = new GhostPoint2D[Capacity];

            this.GhostPoints.CopyTo(ghostPoints, 0);
            ghostPoint2DCollection.GhostPoints.CopyTo(ghostPoints, this.Count);
            this.GhostPoints = ghostPoints;
            CurrentCount    += ghostPoint2DCollection.Count;
        }
コード例 #3
0
        public void Add(GhostPoint2D ghostPoint)
        {
            try
            {
                base.Add();
            }
            catch (CollectionCapacityException e)
            {
                string emsg = e.Message;

                this.Capacity *= 2;

                GhostPoint2D[] ghostPoints = new GhostPoint2D[Capacity];

                this.GhostPoints.CopyTo(ghostPoints, 0);
                this.GhostPoints = ghostPoints;
                base.Add();
            }
            GhostPoints[CurrentCount - 1] = ghostPoint;
        }
コード例 #4
0
 public GhostPoint2DCollection(GhostPoint2D[] ghostPoints)
 {
     Capacity = ghostPoints.Length;
     GhostPoints = ghostPoints;
     CurrentCount = Capacity;
 }
コード例 #5
0
        public void Union(GhostPoint2DCollection ghostPoint2DCollection)
        {
            Capacity += ghostPoint2DCollection.Capacity;

            GhostPoint2D[] ghostPoints = new GhostPoint2D[Capacity];

            this.GhostPoints.CopyTo(ghostPoints, 0);
            ghostPoint2DCollection.GhostPoints.CopyTo(ghostPoints, this.Count);
            this.GhostPoints = ghostPoints;
            CurrentCount += ghostPoint2DCollection.Count;
        }
コード例 #6
0
        public void Add(GhostPoint2D ghostPoint)
        {
            try
            {
                base.Add();
            }
            catch (CollectionCapacityException e)
            {
                string emsg = e.Message;

                this.Capacity *= 2;

                GhostPoint2D[] ghostPoints = new GhostPoint2D[Capacity];

                this.GhostPoints.CopyTo(ghostPoints, 0);
                this.GhostPoints = ghostPoints;
                base.Add();
            }
            GhostPoints[CurrentCount - 1] = ghostPoint;
        }