// Token: 0x060022C4 RID: 8900 RVA: 0x00195948 File Offset: 0x00193B48
        private void Expand()
        {
            int num = BinaryHeap.RoundUpToNextMultipleMod1(Math.Max(this.heap.Length + 4, Math.Min(65533, (int)Math.Round((double)((float)this.heap.Length * this.growthFactor)))));

            if (num > 65534)
            {
                throw new Exception("Binary Heap Size really large (>65534). A heap size this large is probably the cause of pathfinding running in an infinite loop. ");
            }
            BinaryHeap.Tuple[] array = new BinaryHeap.Tuple[num];
            this.heap.CopyTo(array, 0);
            this.heap = array;
        }
Exemple #2
0
        private void Expand()
        {
            int num = BinaryHeap.RoundUpToNextMultipleMod1(Math.Max(this.heap.Length + 4, (int)Math.Round((double)((float)this.heap.Length * this.growthFactor))));

            if (num > 262144)
            {
                throw new Exception("Binary Heap Size really large (2^18). A heap size this large is probably the cause of pathfinding running in an infinite loop. \nRemove this check (in BinaryHeap.cs) if you are sure that it is not caused by a bug");
            }
            BinaryHeap.Tuple[] array = new BinaryHeap.Tuple[num];
            for (int i = 0; i < this.heap.Length; i++)
            {
                array[i] = this.heap[i];
            }
            this.heap = array;
        }
Exemple #3
0
 public BinaryHeap(int capacity)
 {
     capacity           = BinaryHeap.RoundUpToNextMultipleMod1(capacity);
     this.heap          = new BinaryHeap.Tuple[capacity];
     this.numberOfItems = 0;
 }