示例#1
0
        static void Main(string[] args)
        {
            MazeGame game          = new MazeGame();
            var      simpleFactory = new MazePrototypeFactory(new Maze(), new Room(), new Door(), new Wall());
            var      maze          = game.CreateGame(simpleFactory);


            var bombedFactory = new MazePrototypeFactory(new Maze(), new Room(), new Door(), new BombedWall());
            var anotherMaze   = game.CreateGame(bombedFactory);
        }
示例#2
0
        private void CreateGame()
        {
            Maze                 maze;
            MazeGame             game = new MazeGame();
            MazePrototypeFactory simpleMazeFactory = new MazePrototypeFactory(new Maze(), new Room(0), new Wall(), new Door());

            MazePrototypeFactory bombedMazeFactory = new MazePrototypeFactory(new Maze(), new RoomWithABomb(1), new BombedWall(), new Door());

            maze = game.CreateMaze(simpleMazeFactory);
        }