public static TerrainAwarePathFinder TerrainAwarePather(this Map map) { if (!PatherLookup.TryGetValue(map, out TerrainAwarePathFinder pather)) { pather = new TerrainAwarePathFinder(map); PatherLookup.Add(map, pather); } return(pather); }
public static void ResetLookup(this Map map) { // Always replace because tile ids get reused on game loads PatherLookup[map] = new TerrainAwarePathFinder(map); TileLookup[map.Tile] = map; }