public void Regenerate() { for (var x = 0; x < Dimensions.Width; x++) { for (var y = 0; y < Dimensions.Height; ++y) { _elementMatrix[x][y] = CellGenerator.Generate(this, new Coordinates2D(x, y)); } } }
public Stage Generate() { Cell[,] cells = cellGenerator.Generate(stageSize); Room[] rooms = roomGenerator.Generate(cells); RoomConnection[] roomConnections = roomConnector.ConnectRooms(cells, rooms); WallController wallController = wallConstructor.Construct(rooms, stageSize, roomConnections); Navigator navigator = new Navigator(cells); Stage stage = new Stage(stageSize, cells, rooms, navigator, fogOfWarController); cellDecorator.Decorate(stage); wallDecorator.Decorate(cells, wallController); fogOfWarController.ConcealStage(stage); fogOfWarController.Initialize(); creatureSpawner.Spawn(stage); itemSpawner.Spawn(stage, itemController); return(stage); }