static void Main(string[] args) { // Concrete Builder StandardMazeBuilder builder = new StandardMazeBuilder(); // Director MazeGame game = new MazeGame(); game.CreateMaze(builder); // Getting product ... Maze maze = builder.GetMaze(); // Concrete Builder CountingMazeBuilder builderCount = new CountingMazeBuilder(); // Director MazeGame gameCount = new MazeGame(); gameCount.CreateMaze(builderCount); int rooms; int doors; builderCount.GetCounts(out rooms, out doors); Console.WriteLine("The maze has {0} rooms and {1} doors.", rooms, doors); }
static void Main(string[] args) { int rooms, doors; MazeGame game = new MazeGame(); CountingMazeBuilder builder = new CountingMazeBuilder(); game.CreateComplexMaze(builder); builder.GetCounts(out rooms, out doors); }
public void BuildMaze_CountingBuilder_RoomsAndDoorsNumber() { var builder = new CountingMazeBuilder(); var game = new MazeGame(); var maze = game.CreateMaze(builder); builder.Rooms.Should().Be(2); builder.Doors.Should().Be(1); maze.Should().BeNull(); }
public void CreateCountingMazeGameBuilder() { MazeGame game = new MazeGame(); MazeBuilder builder = new CountingMazeBuilder(); int roomsCount = 0, doorsCount = 0; Maze maze = game.CreateMazeBuilder(builder); ((CountingMazeBuilder)builder).GetCounts(ref roomsCount, ref doorsCount); Assert.AreEqual(roomsCount, 2); Assert.AreEqual(doorsCount, 1); }
public Result() { var mazeGame = new MazeGame(); var standartMazeBuilder = new StandartMazeBuilder(); var countingBuilder = new CountingMazeBuilder(); var standartMaze = mazeGame.CreateMaze(standartMazeBuilder); var countingMaze = mazeGame.CreateMaze(countingBuilder); var roomCount = countingBuilder.GetRoomCounts(); var doorCount = countingBuilder.GetDoorCounts(); var complexMaze = mazeGame.CreateComplexMaze(standartMazeBuilder); }
static void Main(string[] args) { MazeBuilder builder = new StandardMazeBuilder(); MazeGame game = new MazeGame(); Maze maze = game.CreateMaseByBuilder(builder); CountingMazeBuilder CountingBuilder = new CountingMazeBuilder(); game.CreateMaseByBuilder(CountingBuilder); int roomCount; int doorCount; CountingBuilder.GetCounts(out roomCount, out doorCount); Console.WriteLine("RoomCount: {0}\nDoorCount: {1}", roomCount, doorCount); }
public void NewGameCount() { Console.WriteLine($"New Game CountingMaze"); MazeGame game = new MazeGame(); Console.WriteLine($"CountingMazeBuilder build Maze"); CountingMazeBuilder countingMazeBuilder = new CountingMazeBuilder(); game.CreateMaze(countingMazeBuilder); Console.WriteLine($"CountingMazeBuilder build complete"); int rooms; int doors; countingMazeBuilder.GetCounts(out rooms, out doors); Console.WriteLine($"Maze has Room Count {rooms} ,Door Count {doors} "); }
public void Setup() { SetOrReset(); countingMazeBuilder = new CountingMazeBuilder(); maze = mazeGame.CreateMaze(countingMazeBuilder); }