public FloodFillRange Dequeue()
        {
            FloodFillRange result = default(FloodFillRange);

            if (this.count > 0)
            {
                result = this.array[this.head];
                this.array[this.head] = default(FloodFillRange);
                this.head++;
                this.count--;
            }
            return(result);
        }
Esempio n. 2
0
        public FloodFillRange Dequeue()
        {
            FloodFillRange result = default(FloodFillRange);

            if (count > 0)
            {
                result      = array[head];
                array[head] = default(FloodFillRange);
                head++;
                count--;
            }
            return(result);
        }
 public void Enqueue(FloodFillRange r)
 {
     if (this.count + this.head == this.array.Length)
     {
         FloodFillRange[] destinationArray = new FloodFillRange[2 * this.array.Length];
         Array.Copy(this.array, this.head, destinationArray, 0, this.count);
         this.array = destinationArray;
         this.head  = 0;
         this.debugNumTimesExpanded++;
     }
     this.array[this.head + this.count++] = r;
     this.debugMaxUsedSpace = this.count + this.head;
 }
Esempio n. 4
0
 public void Enqueue(FloodFillRange r)
 {
     if (count + head == array.Length)
     {
         FloodFillRange[] destinationArray = new FloodFillRange[2 * array.Length];
         Array.Copy(array, head, destinationArray, 0, count);
         array = destinationArray;
         head  = 0;
         debugNumTimesExpanded++;
     }
     array[head + count++] = r;
     debugMaxUsedSpace     = count + head;
 }