diff --git a/Recursion/LD_24/Code/TaskUtils.cs b/Recursion/LD_24/Code/TaskUtils.cs index b907b0f..dc27f35 100644 --- a/Recursion/LD_24/Code/TaskUtils.cs +++ b/Recursion/LD_24/Code/TaskUtils.cs @@ -8,6 +8,11 @@ namespace LD_24.Code public static class TaskUtils { + /// + /// Finds the best possible pizzeria for the given map for the friends to meet up + /// + /// Target map + /// Best pizzeria result object public static BestPizzeriaResult FindBestPizzeria(Map map) { int lowestCost = int.MaxValue; @@ -60,11 +65,27 @@ namespace LD_24.Code } } + /// + /// Finds the minimum distance between 2 points on map. + /// Returns -1, if there is no path + /// + /// Target map + /// From positions + /// To position + /// Minimum distance public static int FindBestPath(Map map, Point from, Point to) { return FindBestPath(map, from, to, new Stack()); } + /// + /// Finds the minimum distance between 2 points on map. + /// Returns -1, if there is no path + /// + /// Target map + /// From positions + /// To position + /// Minimum distance private static int FindBestPath(Map map, Point from, Point to, Stack exploredPoints) { if (from.Equals(to)) { return 0; } @@ -92,6 +113,13 @@ namespace LD_24.Code return minCost; } + /// + /// Returns walkable neighbours around a given point + /// + /// Target map + /// Target x + /// Target y + /// private static IEnumerable GetNeighbours(Map map, int x, int y) { if (map.IsInBounds(x + 1, y) && map.Get(x + 1, y) != MapTile.Wall)