DayZ Scripts
PC Stable Documentation
 
Loading...
Searching...
No Matches
OFSMBase< Class FSMStateBase, Class FSMEventBase, Class FSMActionBase, Class FSMGuardBase > Class Reference

Private Member Functions

void OFSMBase ()
 fsm transition table
 
array< ref FSMStateBase > GetCurrentState ()
 
void SetInitialStates (array< ref FSMStateBase > initial_states)
 
void Start (array< ref FSMEventBase > initial_events=null)
 starts the state machine by entering the initial_state (using intial_event as argument to initial state's onEntry)
 
bool IsRunning ()
 returns true if machine is in running state
 
void Terminate (array< ref FSMEventBase > terminal_events=null)
 terminates the state machine
 
void Update (float dt)
 if machine running, call OnUpdate() on current state
 
void AddTransition (FSMTransition< FSMStateBase, FSMEventBase, FSMActionBase, FSMGuardBase > t)
 adds transition into transition table
 
ProcessEventResult ProcessEvent (FSMEventBase e)
 instructs the state machine to process the event e
 
protected 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
 

Private Attributes

protected ref array< ref FSMStateBase > m_States
 
protected ref array< ref FSMStateBase > m_InitialStates
 current fsm state
 
protected ref array< ref FSMTransition< FSMStateBase, FSMEventBase, FSMActionBase, FSMGuardBase > > m_Transitions
 configurable initial state of the machine
 

Constructor & Destructor Documentation

◆ OFSMBase()

void OFSMBase ( )
inlineprivate

fsm transition table

Member Function Documentation

◆ AddTransition()

AddTransition ( FSMTransition< FSMStateBase, FSMEventBase, FSMActionBase, FSMGuardBase >  t)
inlineprivate

adds transition into transition table

◆ GetCurrentState()

array< ref FSMStateBase > GetCurrentState ( )
inlineprivate

◆ IsRunning()

IsRunning ( )
inlineprivate

returns true if machine is in running state

◆ ProcessEvent()

ProcessEvent ( FSMEventBase  e)
inlineprivate

instructs the state machine to process the event e

Parameters
[in]eevent that will be used to find suitable transition from current state
Returns
FSM_OK if transition found and allowed by guard (if any)

◆ ProcessLocalTransition()

ProcessLocalTransition ( int  s,
FSMTransition< FSMStateBase, FSMEventBase, FSMActionBase, FSMGuardBase >  t,
FSMEventBase  e 
)
inlineprivate

instructs the state machine to process the event locally - no hierarchy is crossed

Parameters
[in]tthe transition in m_transitions
[in]eevent that will be used to process transition from current state
Returns
FSM_OK or FSM_TERMINATED

References fsmbDebugPrint(), and LogManager::IsInventoryHFSMLogEnable().

◆ SetInitialStates()

void SetInitialStates ( array< ref FSMStateBase >  initial_states)
inlineprivate

◆ Start()

Start ( array< ref FSMEventBase >  initial_events = null)
inlineprivate

starts the state machine by entering the initial_state (using intial_event as argument to initial state's onEntry)

Parameters
[in]eoptional event for starting the machind

References fsmbDebugPrint(), LogManager::IsInventoryHFSMLogEnable(), ToString(), and string::ToString().

◆ Terminate()

Terminate ( array< ref FSMEventBase >  terminal_events = null)
inlineprivate

terminates the state machine

References IsRunning().

◆ Update()

Update ( float  dt)
inlineprivate

if machine running, call OnUpdate() on current state

References IsRunning().

Field Documentation

◆ m_InitialStates

protected ref array<ref FSMStateBase> m_InitialStates
private

current fsm state

◆ m_States

protected ref array<ref FSMStateBase> m_States
private

◆ m_Transitions

protected ref array<ref FSMTransition<FSMStateBase, FSMEventBase, FSMActionBase, FSMGuardBase> > m_Transitions
private

configurable initial state of the machine


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