Ejemplo n.º 1
0
        /// <inheritdoc/>
        public void FillLandmark()
        {
            if (Board != null)
            {
                backingStore = new BoardStorage <short>[2] {
                    new BlockedBoardStorage32x32 <short>(Board.MapSizeHexes, c => - 1),
                    new BlockedBoardStorage32x32 <short>(Board.MapSizeHexes, c => - 1)
                };

                for (var i = 0; i < 2; i++)
                {
                    var landmark = Board[Coords];
                    if (landmark != null)
                    {
                        FindPathDetailTrace(true, "Find distances from {0}", landmark.Coords);
                    }

            #if HotPriorityQueue
                    var queue = PriorityQueueFactory.NewHotPriorityQueue <IHex>();
            #else
                    var queue = PriorityQueueFactory.NewDictionaryQueue <int, IHex>();
            #endif
                    queue.Enqueue(0, landmark);

                    FillLandmarkDetail(queue, backingStore[i], DirectedCostDelegates[i](Board));
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>TODO</summary>
        public static ILandmark HotPriorityQueueLandmark(HexCoords coords, INavigableBoard board)
        {
            var backingStore = BackingStore(coords, board, () => PriorityQueueFactory.NewHotPriorityQueue <HexCoords>(1024));

            return(Extensions.InitializeDisposable(() => new Landmark(coords, backingStore)));
        }