Exemple #1
0
        private void SetupWorld(int width, int height)
        {
            _world = WorldBuilder.CreateEmptyWorld(width, height);

            _costCalc      = new BooleanMapCostCalculator(_world);
            _heuristicCalc = new EmptyHeuristicCalculator();

            _explorer = new PathfinderEngine(_world.Width, _world.Height, _costCalc, _heuristicCalc);
        }
Exemple #2
0
        private void ExploreFrom(Coordinate from)
        {
            // Set Pins
            _mapHost.ShowBluePin(from);

            // Setup
            var costCalculator = new BooleanMapCostCalculator(_world)
            {
                BlockPartialDiagonals             = BlockPartialDiagonals,
                HorizontalAndVerticalMovementCost = EdgeMovementCost,
                DiagonalMovementCost = DiagonalMovementCost
            };
            var heuristic  = new EmptyHeuristicCalculator();
            var pathfinder = new PathfinderEngine(_world.Width, _world.Height, costCalculator, heuristic, _movementMode);

            PerformExplore(pathfinder, from);
        }