#include <fsm.h>
Public Types | |
| typedef dtUtil::ObjectFactory < std::string, NPCState > | FactoryType |
| typedef dtCore::RefPtr< NPCState > | StatePtr |
| typedef std::set< StatePtr, RefPtrWithNameCompare < StatePtr > > | StateSet |
| typedef std::pair< const NPCEvent *, StatePtr > | EventStatePtrPair |
| typedef std::map < EventStatePtrPair, StatePtr, PairRefPtrWithNameCompare < EventStatePtrPair > > | TransitionMap |
Public Member Functions | |
| FSM () | |
| FSM (FactoryType *pFactory) | |
| virtual | ~FSM () |
| virtual void | Update (double dt) |
| NPCState * | AddState (const NPCState::Type *state) |
| void | AddTransition (const NPCEvent *eventType, const NPCState *from, const NPCState *to) |
| void | AddTransition (const NPCEvent *eventType, const NPCState::Type *from, const NPCState::Type *to) |
| NPCState * | GetCurrentState () |
| NPCState * | GetState (const NPCState::Type *pStateType) |
| void | MakeCurrent (const NPCState::Type *state) |
| Forces the given State to now be the 'current' State. | |
| bool | HandleEvent (const NPCEvent *pEvent) |
| pass all events through this function | |
Protected Attributes | |
| dtCore::RefPtr< NPCState > | mCurrentState |
Classes | |
| struct | PairRefPtrWithNameCompare |
| Compares a pair, but assumes the 2nd type is a referenced pointer. More... | |
| struct | RefPtrWithNameCompare |
| Compares 2 referenced pointer objects by pointer value and name. More... | |
| typedef dtUtil::ObjectFactory<std::string, NPCState> dtAI::FSM::FactoryType |
| typedef dtCore::RefPtr<NPCState> dtAI::FSM::StatePtr |
| typedef std::set< StatePtr, RefPtrWithNameCompare<StatePtr> > dtAI::FSM::StateSet |
| typedef std::pair< const NPCEvent*, StatePtr > dtAI::FSM::EventStatePtrPair |
| typedef std::map< EventStatePtrPair, StatePtr, PairRefPtrWithNameCompare<EventStatePtrPair> > dtAI::FSM::TransitionMap |
| dtAI::FSM::FSM | ( | ) |
| dtAI::FSM::FSM | ( | FactoryType * | pFactory | ) |
| dtAI::FSM::~FSM | ( | ) | [virtual] |
| void dtAI::FSM::Update | ( | double | dt | ) | [virtual] |
| NPCState * dtAI::FSM::AddState | ( | const NPCState::Type * | state | ) |
| void dtAI::FSM::AddTransition | ( | const NPCEvent * | eventType, | |
| const NPCState * | from, | |||
| const NPCState * | to | |||
| ) | [inline] |
| void dtAI::FSM::AddTransition | ( | const NPCEvent * | eventType, | |
| const NPCState::Type * | from, | |||
| const NPCState::Type * | to | |||
| ) |
| NPCState * dtAI::FSM::GetCurrentState | ( | ) |
| NPCState * dtAI::FSM::GetState | ( | const NPCState::Type * | pStateType | ) |
| void dtAI::FSM::MakeCurrent | ( | const NPCState::Type * | pStateType | ) |
Forces the given State to now be the 'current' State.
| bool dtAI::FSM::HandleEvent | ( | const NPCEvent * | pEvent | ) |
pass all events through this function
dtCore::RefPtr<NPCState> dtAI::FSM::mCurrentState [protected] |