public void TryRepair() { if (map != null) { var listOfObstaclesToRemove = map.Repair(); if (listOfObstaclesToRemove.Count > 0) { mapVisualizer.ClearMap(); mapVisualizer.VisualizeMap(grid, map.ReturnMapData(), visualizeUsingPrefabs); } } }
public void GenerateNewMap() { mapVisualizer.ClearMap(); grid = new MapGrid(width, length); MapHelper.RandomlyChooseAndSetStartAndExit(grid, ref startPosition, ref exitPosition, randomPlacement, startEdge, exitEdge); map = new CandidateMap(grid, numberOfPieces); map.CreateMap(startPosition, exitPosition, autoRepair); mapVisualizer.VisualizeMap(grid, map.ReturnMapData(), visualizeUsingPrefabs); }
public void GenerateNewMap() { // Clears everything in our dictionary and map mapVisualizer.ClearMap(); // Creates a new grid grid = new MapGrid(width, length); // Selects points MapHelper.RandomlyChooseAndSetStartAndExit(grid, ref startPosition, ref exitPosition, randomPlacement, startEdge, exitEdge); // Creates a map and visualizes it map = new CandidateMap(grid, numberOfPieces, enemyCount); map.CreateMap(startPosition, exitPosition, enemyCount, autoRepair); mapVisualizer.VisualizeMap(grid, map.ReturnMapData(), visualizeUsingPrefabs); }