private void Start() { grid = new MapGrid(width, length); gridVisualizer.VisualizeGrid(width, length); MapHelper.RandomlyChooseAndSetStartAndExit(grid, ref startPosition, ref exitPosition, randomPlacement, startEdge, exitEdge); CandidateMap map = new CandidateMap(grid, numberOfPieces); map.CreateMap(startPosition, exitPosition); mapVisualizer.VisualizeMap(grid, map.ReturnMapData(), false); }
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); }