Beispiel #1
0
        private LinkedList<Tile> GetPath(Location loc1, Location loc2, GameState state)
        {
            if (Math.Abs(loc1.Col - loc2.Col) > state.ViewRadius2 || Math.Abs(loc1.Row - loc2.Row) > state.ViewRadius2)
            {
                Log("closest is a map wrap - use basic path function");
                return state.GetPath(loc1, loc2);

            }
            else
            {
                Log("use astar path function");
                return astar.Search(loc1.ToPoint(), loc2.ToPoint(), new Object());
            }
        }