28#ifndef HPL_STATE_MACHINE_H
29#define HPL_STATE_MACHINE_H
31#include "hpl1/engine/game/GameTypes.h"
32#include "hpl1/engine/system/SystemTypes.h"
34#include "common/stablemap.h"
48 virtual void OnUpdate(
float afTime) = 0;
50 virtual void OnEnterState(
int alLastState) = 0;
51 virtual void OnLeaveState(
int alNextState) = 0;
53 int GetId() {
return mlId; }
54 const tString &GetName() {
return msName; }
55 float GetUpdateStep() {
return mfUpdateStep; }
57 void Sleep(
float afTime);
66 void Update(
float afTime);
67 void SetStateMachine(
cStateMachine *apStateMachine) { mpStateMachine = apStateMachine; }
82 void Update(
float afTime);
89 void ChangeState(
int alId);
91 void SetActive(
bool abX) { mbActive = abX; }
92 bool IsActive() {
return mbActive; }
94 iAIState *GetState(
int alId);
96 iAIState *CurrentState();
101 tAIStateMap m_mapStates;
103 iAIState *mpCurrentState;
typename TreeT::BasicIterator iterator
Definition: stablemap.h:48
Definition: StateMachine.h:77
void AddState(iAIState *apState, const tString &asName, int alId, float afUpdateStep)
Definition: StateMachine.h:41