dxf::RegistrarInterface Class Reference

#include <dxf_game.h>

List of all members.

Public Member Functions

virtual void RegisterStates ()=0
virtual void RegisterCommands ()


Detailed Description

Client applications define these two functions which are called when loading the engine. The RegisterStates function defines the states, RegisterCommands defines custom commands for the console.

Definition at line 40 of file dxf_game.h.


Member Function Documentation

virtual void dxf::RegistrarInterface::RegisterCommands (  )  [inline, virtual]

This function is called when the engine first loads and is for allowing the client (application) to define custom commands for the console interface.

An example body of this function is: dxf::DXFRegisterCommand(L"add", &add);

This adds a command "add" to the console that calls the function pointer add() with a vector of strings of all of the command line tokens.

You need not define this function.

Definition at line 81 of file dxf_game.h.

Referenced by dxf::Game::Load().

virtual void dxf::RegistrarInterface::RegisterStates (  )  [pure virtual]

This function is called when the engine first loads. The purpose of this function is to allow the client (application) to define states in the client code and register pointers to those states in the engine so that the DXFramework state machine can transition from state to state.

An example body of this function is: dxf::DXFRegisterState(kTitle, &title); dxf::DXFRegisterState(kKeyboard, &keyboard);

The first line here maps the string constant "Title" (kTitle) with the pointer to the title state object.

The second line registers the string constand "Keyboard" (kKeyboard) with the pointer to the keyboard state object.

To change states in the future, simply call the function DXFChangeState with one of the registered string constants like so: dxf::DXFChangeState(Registrar::kKeyboard);

This line changes the state to the keyboard state.

Finally, the first registered state is the initial state, which is why title is registered before keyboard.

See also DXFRegisterState, DXFChangeState, GameState

Referenced by dxf::Game::Load().


The documentation for this class was generated from the following file:
Generated on Fri Aug 18 12:01:28 2006 for DXFramework by  doxygen 1.4.7