Exemple #1
0
        public void RandomPathFinder()
        {
            lock (typeof(MoveTo))
            {
                AStarFindHeuristic afh = null;
                int index = Loon.Utils.MathUtils.Random(AStarFindHeuristic.MANHATTAN,
                                                        AStarFindHeuristic.CLOSEST_SQUARED);
                switch (index)
                {
                case AStarFindHeuristic.MANHATTAN:
                    afh = Loon.Action.Map.AStarFinder.ASTAR_EUCLIDEAN;
                    break;

                case AStarFindHeuristic.MIXING:
                    afh = Loon.Action.Map.AStarFinder.ASTAR_MIXING;
                    break;

                case AStarFindHeuristic.DIAGONAL:
                    afh = Loon.Action.Map.AStarFinder.ASTAR_DIAGONAL;
                    break;

                case AStarFindHeuristic.DIAGONAL_SHORT:
                    afh = Loon.Action.Map.AStarFinder.ASTAR_DIAGONAL_SHORT;
                    break;

                case AStarFindHeuristic.EUCLIDEAN:
                    afh = Loon.Action.Map.AStarFinder.ASTAR_EUCLIDEAN;
                    break;

                case AStarFindHeuristic.EUCLIDEAN_NOSQR:
                    afh = Loon.Action.Map.AStarFinder.ASTAR_EUCLIDEAN_NOSQR;
                    break;

                case AStarFindHeuristic.CLOSEST:
                    afh = Loon.Action.Map.AStarFinder.ASTAR_CLOSEST;
                    break;

                case AStarFindHeuristic.CLOSEST_SQUARED:
                    afh = Loon.Action.Map.AStarFinder.ASTAR_CLOSEST_SQUARED;
                    break;
                }
                SetHeuristic(afh);
            }
        }
Exemple #2
0
 public void SetHeuristic(AStarFindHeuristic h)
 {
     this.heuristic = h;
 }
Exemple #3
0
 public void setHeuristic(AStarFindHeuristic heuristic)
 {
     this.heuristic = heuristic;
 }