36 for (
int s = 0; s < initial_states.Count(); ++s)
48 for (
int s = 0; s <
m_States.Count(); ++s)
53 m_States[s].OnEntry(initial_events[s]);
67 for (
int s = 0; s < sc; ++s)
81 for (
int s = 0; s <
m_States.Count(); ++s)
84 m_States[s].OnExit(terminal_events[s]);
100 for (
int s = 0; s <
m_States.Count(); ++s)
123 for (
int i = 0; i < count; ++i)
126 if (row.m_event.Type() == e.Type())
128 for (
int s = 0; s <
m_States.Count(); ++s)
130 if (row.m_srcState.Type() ==
m_States[s].Type() && row.m_event.Type() == e.Type())
133 bool hasGuard = t.m_guard != NULL;
134 if (!hasGuard || (hasGuard && t.m_guard.GuardCondition(e)))
153 if (
LogManager.
IsInventoryHFSMLogEnable())
fsmbDebugPrint(
"[ofsm] (local) state=" + t.m_srcState.ToString() +
"-------- event=" + e.ToString() +
"[G=" + t.m_guard.ToString() +
"]/A=" + t.m_action.ToString() +
" --------|> dst=" + t.m_dstState.ToString());
158 t.m_action.Action(e);
162 if (t.m_dstState != NULL)
void fsmbDebugPrint(string s)
Super root of all classes in Enforce script.
represents transition src -— event[guard]/action -—|> dst
static bool IsInventoryHFSMLogEnable()
void Start(array< ref FSMEventBase > initial_events=null)
starts the state machine by entering the initial_state (using intial_event as argument to initial sta...
ProcessEventResult ProcessLocalTransition(int s, FSMTransition< FSMStateBase, FSMEventBase, FSMActionBase, FSMGuardBase > t, FSMEventBase e)
instructs the state machine to process the event locally - no hierarchy is crossed
bool IsRunning()
returns true if machine is in running state
void AddTransition(FSMTransition< FSMStateBase, FSMEventBase, FSMActionBase, FSMGuardBase > t)
adds transition into transition table
ref array< ref FSMStateBase > m_States
void Update(float dt)
if machine running, call OnUpdate() on current state
void OFSMBase()
fsm transition table
ref array< ref FSMStateBase > m_InitialStates
current fsm state
void SetInitialStates(array< ref FSMStateBase > initial_states)
ref array< ref FSMTransition< FSMStateBase, FSMEventBase, FSMActionBase, FSMGuardBase > > m_Transitions
configurable initial state of the machine
ProcessEventResult ProcessEvent(FSMEventBase e)
instructs the state machine to process the event e
void Terminate(array< ref FSMEventBase > terminal_events=null)
terminates the state machine
array< ref FSMStateBase > GetCurrentState()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.