Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

peon::IApplication Class Reference

This object is responsible for containing any "application global" structures or handles. More...

#include <IApplication.h>

List of all members.

Public Member Functions

 IApplication ()
 Constructor.
virtual ~IApplication ()
 Destructor.
virtual bool onLoadWorld ()=0
 This method is called when loading the game world.
virtual void onUnloadWorld ()=0
 This method is called when unloading the game world.
virtual void onRenderWorld ()
 This method is called when it's time to pass any rendering command to the engine.
virtual void onUpdateWorld (float fElapsedTime)=0
 This method is called when it's time to update the objects in the game world.
bool loadState (int key, IApplicationState *pState)
 This method is responsible for loading the given IApplicationState along with registering it into our hashtable.
void unloadStates ()
 This is an internal method to clean up all the states.
IApplicationStategetCurrentState ()
 This just returns the current IApplicationState that the engine is working with.
void setCurrentState (int key)
 Set the current state to the one specified by the key identifier param key - key to set current state to.
virtual void onKeyEvent (SDL_KeyboardEvent *pEvent)
 This method is overrideable to provide quick keyboard access to the current state.
virtual void onMouseEvent (SDL_Event *pEvent)
 This method is overrideable to provide quick mouse access to the current state.

Protected Attributes

std::map< int, IApplicationState * > m_oStates
 a hashmap container of our IApplicationState pointers
IApplicationStatem_pCurrentState
 a handle to our current IApplicationState instance


Detailed Description

This object is responsible for containing any "application global" structures or handles.

You should stick state-specific objects into an IApplicationState instance, but any object that needs to be referenced by all the internal states should be thrown into here


Member Function Documentation

IApplicationState* peon::IApplication::getCurrentState  )  [inline]
 

This just returns the current IApplicationState that the engine is working with.

Returns:
IApplicationState* - a handle to the current IApplicationState

bool peon::IApplication::loadState int  key,
IApplicationState pState
 

This method is responsible for loading the given IApplicationState along with registering it into our hashtable.

Parameters:
key - key id for the local hashmap
pState - a new
Returns:
bool - TRUE if everything initialized okay

virtual void peon::IApplication::onKeyEvent SDL_KeyboardEvent *  pEvent  )  [inline, virtual]
 

This method is overrideable to provide quick keyboard access to the current state.

Parameters:
pEvent - a generated SDL_KeyboardEvent handle

virtual bool peon::IApplication::onLoadWorld  )  [pure virtual]
 

This method is called when loading the game world.

In here we should be loading all of the internal IApplicationState instances along with any "global level" objects

Returns:
bool - true if successfull

virtual void peon::IApplication::onMouseEvent SDL_Event *  pEvent  )  [inline, virtual]
 

This method is overrideable to provide quick mouse access to the current state.

Parameters:
pEvent - a generated SDL_Event message

virtual void peon::IApplication::onUnloadWorld  )  [pure virtual]
 

This method is called when unloading the game world.

Basically any object that we created at a global level should be cleaned up here. Note that the IApplicationState instances are cleanup automatically, so you do not need to worry about them.

virtual void peon::IApplication::onUpdateWorld float  fElapsedTime  )  [pure virtual]
 

This method is called when it's time to update the objects in the game world.

Parameters:
fElapsedTime - the time differential used for object position calculations


The documentation for this class was generated from the following file:
Generated on Thu Dec 1 01:55:41 2005 for Peon by  doxygen 1.4.1