MazeController Class Reference
[Maze minigame]

#include <MazeController.h>

Inherits GameController.

Collaboration diagram for MazeController:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 MazeController (int level)
virtual ~MazeController ()
void step ()
 This function will be called each time unit of the game.
void draw (BITMAP *bmp)
 This function will also be called each screen refresh to draw to the buffer.
bool isComplete ()
 Will return true if the maze is completed successfully.
void setRunFailed ()
 This is called to exit the MazeController and go back to the menu.
GraphicgetDirections ()
 This returns the proper directions for the controller.

Static Public Member Functions

static void defineNames ()

Private Member Functions

MazeProgrammingControllergenerateProgrammingController (int level, bool retry)
void setRunController ()
 Create a MazeRunController from the current Command Sequence and set it as the subcontroller.
void setProgrammingController ()
 Create a MazeRunController and set it as the subcontroller.
RobotMazegenerateMaze (int level)
void setupButtonSpots ()
list< MazeCommand > * getCommandSequence ()
 Return a list of the commands, substituting the subroutine for subroutine commands.
list< MazeCommand > * getSubroutineSequence ()
 Get the list of commands in the subroutine.

Private Attributes

list< ButtonSpot * > * CommandSpots
 These are the lists keeping track of what are in the instructions and subroutine instructions areas.
list< ButtonSpot * > * SubroutineSpots
GameControllercontroller
 This is the current controller underneath, either a MazeProgrammingController or MazeRunController.
RobotMazeMaze
 This is the maze information for this level.
bool complete
 This will be set to true when this level is completed successfully.
bool runFailed
bool programmingMode
int Level
int endCount


Constructor & Destructor Documentation

MazeController::MazeController ( int  level  ) 

MazeController::~MazeController (  )  [virtual]


Member Function Documentation

void MazeController::defineNames (  )  [static]

void MazeController::draw ( BITMAP *   )  [virtual]

This function will also be called each screen refresh to draw to the buffer.

Implements GameController.

RobotMaze * MazeController::generateMaze ( int  level  )  [private]

Gets the correct RobotMaze depending on the level, this function stores the actual data on what the different mazes look like

MazeProgrammingController * MazeController::generateProgrammingController ( int  level,
bool  retry 
) [private]

This fetches the correct MazeProgrammingController, which will have different commands available depending on which level the player is on

list< MazeCommand > * MazeController::getCommandSequence (  )  [private]

Return a list of the commands, substituting the subroutine for subroutine commands.

Graphic* MazeController::getDirections (  )  [inline, virtual]

This returns the proper directions for the controller.

Reimplemented from GameController.

list< MazeCommand > * MazeController::getSubroutineSequence (  )  [private]

Get the list of commands in the subroutine.

bool MazeController::isComplete (  )  [inline, virtual]

Will return true if the maze is completed successfully.

Implements GameController.

void MazeController::setProgrammingController (  )  [private]

Create a MazeRunController and set it as the subcontroller.

void MazeController::setRunController (  )  [private]

Create a MazeRunController from the current Command Sequence and set it as the subcontroller.

void MazeController::setRunFailed (  ) 

This is called to exit the MazeController and go back to the menu.

void MazeController::setupButtonSpots (  )  [private]

This function creates the CommandSpots and SubroutineSpots, calculating their locations and constructing them.

void MazeController::step (  )  [virtual]

This function will be called each time unit of the game.

Implements GameController.


Member Data Documentation

These are the lists keeping track of what are in the instructions and subroutine instructions areas.

bool MazeController::complete [private]

This will be set to true when this level is completed successfully.

This is the current controller underneath, either a MazeProgrammingController or MazeRunController.

int MazeController::endCount [private]

The game will wait this many steps after the MazeRunController successfully completes to show the player the win frame

int MazeController::Level [private]

This is the level for the current game

This is the maze information for this level.

This is true if the current controller is a MazeProgrammingController

bool MazeController::runFailed [private]

This will be set to true if the run failed in the MazeRunController, and will be used to switch back to the MazeProgrammingController


The documentation for this class was generated from the following files:

Generated on Mon Mar 16 14:33:12 2009 for LearningGaming by  doxygen 1.5.7.1