public PathFinder(LevelMap map) { doneCalculating = false; SetMapTiles(map); currentCoordinates = new List<Vector2>(); adjacentCoordinates = new List<Vector2>(); nextCurrentCoordinates = new List<Vector2>(); completeCoordinates = new List<Vector2>(); }
public void SetMapTiles(LevelMap map) { mapDemensions = map.MAPSIZE; gameTiles = new int[(int)mapDemensions.X, (int)mapDemensions.Y]; for (int row = 0; row < mapDemensions.X; row++) for (int col = 0; col < mapDemensions.Y; col++) { if (map.GetTileState(row, col)) { gameTiles[row, col] = -1; } else gameTiles[row, col] = 0; } }
public void UpDateTiles(LevelMap map) { for (int row = 0; row < mapDemensions.X; row++) for (int col = 0; col < mapDemensions.Y; col++) { if (map.GetTileState(row, col)) { gameTiles[row, col] = -1; } else gameTiles[row, col] = 0; } }
public void HighlightPath(LevelMap map) { map.HighlightPath(this); }