#include <CStateManager.h>
Inherits ISingleton< CStateFactory >.
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. | |
| ISimulationState * | getState (uint32 stateId) |
| Get an object of the specified state. | |
| ISimulationState * | getDefault (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 uint32 * | TDefaultMap |
| 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 |
Definition at line 58 of file CStateManager.h.
| typedef ISimulationState*(* WWCOMMON::CStateFactory::CreateState)() |
Type for the create method to instantiate a state.
Definition at line 103 of file CStateManager.h.
typedef uint32* WWCOMMON::CStateFactory::TDefaultMap [protected] |
Defines the type for the map of default states for layers.
Definition at line 121 of file CStateManager.h.
typedef std::map<uint32, ISimulationState *> WWCOMMON::CStateFactory::TStateMap [protected] |
Defines the type for the map of simulation states.
Definition at line 119 of file CStateManager.h.
Definition at line 93 of file CStateManager.h.
Defines the IDs for each state class.
Definition at line 61 of file CStateManager.h.
| WWCOMMON::CStateFactory::CStateFactory | ( | ) |
Definition at line 53 of file CStateManager.cpp.
References m_DefaultMap, ST_AC_IDLE, ST_ACTION, ST_LAYER_END, ST_MOVEMENT, ST_MV_IDLE, ST_OR_IDLE, ST_ORIENTATION, ST_POSTURE, ST_PS_STANDING, ST_ST_IDLE, and ST_STRAFE.
| WWCOMMON::CStateFactory::~CStateFactory | ( | ) |
Definition at line 63 of file CStateManager.cpp.
References m_DefaultMap.
| 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 | ) |
Get an object of the specified state.
Definition at line 73 of file CStateManager.cpp.
References m_StateMap, and nlwarning.
Referenced by WWCOMMON::CMotionHandler::changeState(), getDefault(), WWCOMMON::CRequestHandler::handleStateRequestEvent(), and WWCOMMON::ISimulationObj::setActiveStateList().
| bool WWCOMMON::CStateFactory::Register | ( | uint32 | type, | |
| CreateState | create | |||
| ) |
TDefaultMap WWCOMMON::CStateFactory::m_DefaultMap [protected] |
Definition at line 125 of file CStateManager.h.
Referenced by CStateFactory(), getDefault(), and ~CStateFactory().
TStateMap WWCOMMON::CStateFactory::m_StateMap [protected] |
A map of simulation states registered for the factory.
Definition at line 124 of file CStateManager.h.
Referenced by getState(), and Register().
1.6.1