// Non-flexible implemantation, replaced. //public static Maze CreateMaze() //{ // Maze maze = new Maze(); // Room room1 = new Room(1); // Room room2 = new Room(2); // Door door = new Door(room1, room2); // maze.AddRoom(room1); // maze.AddRoom(room2); // room1.SetSide(Direction.North, new Wall()); // room1.SetSide(Direction.East, door); // room1.SetSide(Direction.South, new Wall()); // room1.SetSide(Direction.West, new Wall()); // room2.SetSide(Direction.North, new Wall()); // room2.SetSide(Direction.East, new Wall()); // room2.SetSide(Direction.South, new Wall()); // room2.SetSide(Direction.West, door); // return maze; //} public static Maze CreateMaze(MazeFactory factory) { Maze maze = factory.MakeMaze(); Room room1 = factory.MakeRoom(1); Room room2 = factory.MakeRoom(2); Door door = factory.MakeDoor(room1, room2); maze.AddRoom(room1); maze.AddRoom(room2); ConnectFromEastToWest(room1, room2, door); return(maze); }
public Maze CreateMaze(MazeFactory factory) { Maze aMaze = factory.MakeMaze(); Room r1 = factory.MakeRoom(1); Room r2 = factory.MakeRoom(2); Door theDoor = factory.MakeDoor(r1,r2); aMaze.AddRoom(r1); aMaze.AddRoom(r2); r1.SetSide(Direction.North, factory.MakeWall()); r1.SetSide(Direction.East, theDoor); r1.SetSide(Direction.South, factory.MakeWall()); r1.SetSide(Direction.West, factory.MakeWall()); r2.SetSide(Direction.North, factory.MakeWall()); r2.SetSide(Direction.East, factory.MakeWall()); r2.SetSide(Direction.South, factory.MakeWall()); r2.SetSide(Direction.West, theDoor); return aMaze; }
public Maze CreateMaze(MazeFactory factory) { Maze aMaze = factory.MakeMaze(); Room r1 = factory.MakeRoom(1); Room r2 = factory.MakeRoom(2); Door theDoor = factory.MakeDoor(r1, r2); aMaze.AddRoom(r1); aMaze.AddRoom(r2); r1.SetSide(Direction.North, factory.MakeWall()); r1.SetSide(Direction.East, theDoor); r1.SetSide(Direction.South, factory.MakeWall()); r1.SetSide(Direction.West, factory.MakeWall()); r2.SetSide(Direction.North, factory.MakeWall()); r2.SetSide(Direction.East, factory.MakeWall()); r2.SetSide(Direction.South, factory.MakeWall()); r2.SetSide(Direction.West, theDoor); return(aMaze); }