WWCOMMON::CStateFactory Class Reference

#include <CStateManager.h>

Inherits ISingleton< CStateFactory >.

List of all members.

Public Types

enum  eTargetState {
  ST_NONE = 0, ST_MV_IDLE = 10, ST_MV_FORWARD = 11, ST_MV_BACKWARD = 12,
  ST_ST_IDLE = 13, ST_ST_LEFT = 14, ST_ST_RIGHT = 15, ST_OR_IDLE = 20,
  ST_OR_TURNLEFT = 21, ST_OR_TURNRIGHT = 22, ST_PS_STANDING = 30, ST_PS_SITTING = 31,
  ST_PS_WALKING = 32, ST_PS_RUNNING = 33, ST_AC_IDLE = 40, ST_AC_SPAWNING = 41,
  ST_STATE_END
}
 

Defines the IDs for each state class.

More...
enum  eStateLayer {
  ST_MOVEMENT = 0, ST_POSTURE = 1, ST_ACTION = 2, ST_STRAFE = 3,
  ST_ORIENTATION = 4, ST_LAYER_END
}
typedef ISimulationState *(* CreateState )()
 Type for the create method to instantiate a state.

Public Member Functions

 CStateFactory ()
 ~CStateFactory ()
bool Register (uint32 type, CreateState create)
 Register a state type.
ISimulationStategetState (uint32 stateId)
 Get an object of the specified state.
ISimulationStategetDefault (uint8 layerId)
 Get the default state for the given state layer.

Protected Types

typedef std::map< uint32,
ISimulationState * > 
TStateMap
 Defines the type for the map of simulation states.
typedef uint32TDefaultMap
 Defines the type for the map of default states for layers.

Protected Attributes

TStateMap m_StateMap
 A map of simulation states registered for the factory.
TDefaultMap m_DefaultMap

Detailed Description

Definition at line 58 of file CStateManager.h.


Member Typedef Documentation

Type for the create method to instantiate a state.

Definition at line 103 of file CStateManager.h.

Defines the type for the map of default states for layers.

Definition at line 121 of file CStateManager.h.

Defines the type for the map of simulation states.

Definition at line 119 of file CStateManager.h.


Member Enumeration Documentation

Enumerator:
ST_MOVEMENT 
ST_POSTURE 
ST_ACTION 
ST_STRAFE 
ST_ORIENTATION 
ST_LAYER_END 

Definition at line 93 of file CStateManager.h.

Defines the IDs for each state class.

Enumerator:
ST_NONE 
ST_MV_IDLE 

No forward/backward movement - idle and stopped.

ST_MV_FORWARD 

Moving forward.

ST_MV_BACKWARD 

Moving backward.

ST_ST_IDLE 

No sideways movement.

ST_ST_LEFT 

Strafing to facing-left.

ST_ST_RIGHT 

strafing to facing-right.

ST_OR_IDLE 

Character is not turning.

ST_OR_TURNLEFT 

Character is turning facing-left.

ST_OR_TURNRIGHT 

Character is turning facing-right.

ST_PS_STANDING 

Character is standing.

ST_PS_SITTING 

Character is sitting.

ST_PS_WALKING 

Character is walking.

ST_PS_RUNNING 

Character is running.

ST_AC_IDLE 

Character is idle.

ST_AC_SPAWNING 

Character is spawning. This state blocks all for it's duration.

ST_STATE_END 

Definition at line 61 of file CStateManager.h.


Constructor & Destructor Documentation

WWCOMMON::CStateFactory::CStateFactory (  ) 
WWCOMMON::CStateFactory::~CStateFactory (  ) 

Definition at line 63 of file CStateManager.cpp.

References m_DefaultMap.


Member Function Documentation

ISimulationState * WWCOMMON::CStateFactory::getDefault ( uint8  layerId  ) 

Get the default state for the given state layer.

Definition at line 84 of file CStateManager.cpp.

References getState(), m_DefaultMap, and ST_LAYER_END.

ISimulationState * WWCOMMON::CStateFactory::getState ( uint32  stateId  ) 
bool WWCOMMON::CStateFactory::Register ( uint32  type,
CreateState  create 
)

Register a state type.

Definition at line 68 of file CStateManager.cpp.

References m_StateMap.


Member Data Documentation

Definition at line 125 of file CStateManager.h.

Referenced by CStateFactory(), getDefault(), and ~CStateFactory().

A map of simulation states registered for the factory.

Definition at line 124 of file CStateManager.h.

Referenced by getState(), and Register().


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

Generated on Mon Jan 11 12:04:40 2010 for Werewolf by  doxygen 1.6.1