Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var mazeDirector = new MazeGame(new StandardMazeBuilder());
            var maze         = mazeDirector.CreateMaze();

            var anotherMazeDirector = new MazeGame(new CountingMazeBuilder());
            var anotherMaze         = anotherMazeDirector.CreateMaze();
        }
Exemplo n.º 2
0
        private static void StandartInstance()
        {
            Maze                maze;
            MazeGame            mazeGame = new MazeGame();
            StandartMazeBuilder builder  = new StandartMazeBuilder();

            mazeGame.CreateMaze(builder);

            maze = builder.GetMaze();
        }
Exemplo n.º 3
0
        private static void CountingInstance()
        {
            int rooms, doors;

            Maze                maze;
            MazeGame            game    = new MazeGame();
            CountingMazeBuilder builder = new CountingMazeBuilder();

            game.CreateMaze(builder);

            maze = builder.GetMaze();
            builder.GetCounts(out rooms, out doors);

            Console.WriteLine($"Rooms: {rooms}, Doors: {doors}");
        }