hoa_mode_manager::GameMode Class Reference

An abstract class that all game mode classes inherit from. More...

#include <mode_manager.h>

Inheritance diagram for hoa_mode_manager::GameMode:

Inheritance graph
[legend]
Collaboration diagram for hoa_mode_manager::GameMode:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void Draw ()=0
 Draws the next screen frame for the game mode.
 GameMode (uint8 mt)
 
Parameters:
mt The mode_type to set the new GameMode object to.

 GameMode ()
virtual void Reset ()=0
 Resets the state of the class.
virtual void Update ()=0
 Updates the state of the game mode.
virtual ~GameMode ()
 Destructor is virutal, since the inherited class holds all the important data.

Protected Attributes

uint8 mode_type
 Indicates what 'mode' this object is in (what type of inherited class).

Private Member Functions

 GameMode (const GameMode &other)
 Copy constructor is private, because making a copy of a game mode object is a bad idea.
GameModeoperator= (const GameMode &other)
 Copy assignment operator is private, because making a copy of a game mode object is a bad idea.

Friends

class GameModeManager

Detailed Description

An abstract class that all game mode classes inherit from.

***************************************************************************

The GameMode class is the starting base for developing a new mode of operation for the game. The GameModeManager class handles all of the GameMode class objects. One should learn to understand the interaction between these two classes.

Note:
THIS IS VERY IMPORTANT. Never, under any circumstances should you ever invoke the delete function on a pointer to this object or its related subclasses. The reason is that all of the memory reference handling is done by the GameModeManager class. If you attempt to ignore this warning you will generate a segmentation fault.

Definition at line 61 of file mode_manager.h.


Constructor & Destructor Documentation

hoa_mode_manager::GameMode::GameMode ( const GameMode other  )  [private]

Copy constructor is private, because making a copy of a game mode object is a bad idea.

hoa_mode_manager::GameMode::GameMode (  ) 

Definition at line 38 of file mode_manager.cpp.

References hoa_mode_manager::MODE_MANAGER_DEBUG, hoa_mode_manager::MODE_MANAGER_DUMMY_MODE, and mode_type.

hoa_mode_manager::GameMode::GameMode ( uint8  mt  ) 

Parameters:
mt The mode_type to set the new GameMode object to.

Definition at line 45 of file mode_manager.cpp.

References hoa_mode_manager::MODE_MANAGER_DEBUG, and mode_type.

hoa_mode_manager::GameMode::~GameMode (  )  [virtual]

Destructor is virutal, since the inherited class holds all the important data.

Definition at line 50 of file mode_manager.cpp.

References hoa_mode_manager::MODE_MANAGER_DEBUG.


Member Function Documentation

virtual void hoa_mode_manager::GameMode::Draw (  )  [pure virtual]

Draws the next screen frame for the game mode.

Implemented in hoa_battle::BattleMode, hoa_boot::BootMode, hoa_map::MapMode, hoa_menu::MenuMode, hoa_pause::PauseMode, hoa_quit::QuitMode, hoa_scene::SceneMode, and hoa_shop::ShopMode.

GameMode& hoa_mode_manager::GameMode::operator= ( const GameMode other  )  [private]

Copy assignment operator is private, because making a copy of a game mode object is a bad idea.

virtual void hoa_mode_manager::GameMode::Reset (  )  [pure virtual]

Resets the state of the class.

This function is called whenever the game mode is made active (ie, it is made the new active game mode on the top of the game modestack). This includes when the game mode is first created and pushed onto the game stack, so in that manner it can also be viewed as a helper function to the constructor.

Implemented in hoa_battle::BattleMode, hoa_boot::BootMode, hoa_map::MapMode, hoa_menu::MenuMode, hoa_pause::PauseMode, hoa_quit::QuitMode, hoa_scene::SceneMode, and hoa_shop::ShopMode.

virtual void hoa_mode_manager::GameMode::Update (  )  [pure virtual]

Updates the state of the game mode.

Implemented in hoa_battle::BattleMode, hoa_boot::BootMode, hoa_map::MapMode, hoa_menu::MenuMode, hoa_pause::PauseMode, hoa_quit::QuitMode, hoa_scene::SceneMode, and hoa_shop::ShopMode.


Friends And Related Function Documentation

friend class GameModeManager [friend]

Definition at line 62 of file mode_manager.h.


Member Data Documentation

uint8 hoa_mode_manager::GameMode::mode_type [protected]

Indicates what 'mode' this object is in (what type of inherited class).

Definition at line 66 of file mode_manager.h.

Referenced by hoa_battle::BattleMode::BattleMode(), hoa_boot::BootMode::BootMode(), GameMode(), hoa_pause::PauseMode::PauseMode(), hoa_quit::QuitMode::QuitMode(), hoa_scene::SceneMode::SceneMode(), and hoa_shop::ShopMode::ShopMode().


The documentation for this class was generated from the following files:
Generated on Fri Jul 6 23:15:32 2007 for Hero of Allacrost by  doxygen 1.5.1