Maze with Classes

Study Call Hierarchy feature of MSVS described here. As you work on the below project, demonstrate viewing code hierarchy to the lab instructor.

In this project, you are to re-code the maze navigation game using classes. The data code and data is declared this header file. The information about room, room pairs and the maze encapsulated in classes.

Assignments

  1. Test. Create a project titled Lab9_Test. Add header file maze.hpp. to the project. Add test source file testMaze.cpp to the project. Define member functions for the classes of maze.hpp and place the defined member functions in maze.cpp. Where appropriate, constructor definitions should use intializer lists.

    You should implement the member functions for classes incrementally. Start with implementing member functions for class Room, then proceed to RoomPair and then to Maze. Uncomment the portions of testMaze.cpp as you work on a particular class. Once your project works correctly with all code of testMaze.cpp uncommented, submit your project.

  2. Game. Create a project titled Lab9_Game. Use maze.hpp, maze.cpp from the test assignment above; add game.cpp that contains main() , invokes the game functions declared in maze.hpp and implements the maze navigation game

    Hint: the pseudocode for your main() should be as follows:

        declare an object of class Maze
        declare a finish room with the cheese
        call build() method on the maze
        prompt the user if she wants to see the maze wall positions printed
        loop while the current mouse location is not the finish room and the user
             wants to continue the game (the selected room is not the -1*)
             inside the loop
                  get the current mouse room
                  print it
                  on the basis of the current room, get the next room from the user,
                  invoke move() with this next room
                  analyze the return value from this move() to see if it was successful
                  if not: report a wall
      
Make sure your programs adhere to proper programming style. Submit your projects to the subversion repository. Do not forget to verify your submission on the web.

Milestone: member functions for Room and RoomPair are implemented.