public static void Main() { MazeFactory factory = new MazeFactory(); MazeGame game = new MazeGame(); Maze maze = game.CreateMaze(factory); MazeFactory airMazeFactory = new AirMazeFactory(); maze = game.CreateMaze(airMazeFactory); }
public Maze CreateMaze(MazeFactory factory) { Maze maze = factory.MakeMaze(); Room room1 = factory.MakeRoom(); Room room2 = factory.MakeRoom(); maze.AddRoom(room1); maze.AddRoom(room2); return(maze); }