- Gof/FactoryMethod . . . . 4 matches
The function CreateMaze (page 84) builds and returns a maze. One problem with this function is that it hard-codes the classes of maze, rooms, doors, and walls. We'll introduce factory methods to let subclasses choose these components.
Maze* CreateMaze();
Now we can rewrite CreateMaze to use these factory methods:
Maze* MazeGame::CreateMaze () {