Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public FloodFillRange Dequeue()
        {
            FloodFillRange result = default(FloodFillRange);

            if (count > 0)
            {
                result      = array[head];
                array[head] = default(FloodFillRange);
                head++;
                count--;
            }
            return(result);
        }
Exemplo n.º 3
0
 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;
 }
Exemplo 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;
 }