예제 #1
0
        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);
        }
예제 #2
0
        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);
        }