41 return m_fsm.SaveCurrentFSMState(ctx);
47 return m_fsm.SaveCurrentUnstableFSMState(ctx);
61 if (
m_fsm.LoadCurrentFSMState(ctx, version))
64 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponStateBase::LoadCurrentFSMState - Cannot load stable state for weapon=" +
this);
70 if (
m_fsm.LoadCurrentUnstableFSMState(ctx, version))
73 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponStateBase::LoadCurrentFSMState - Cannot load unstable state for weapon=" +
this);
83 return m_fsm.ProcessEvent(e);
92 m_fsm.AddTransition(t);
94 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" adding transition to state without FSM. Configure FSM first.");
122 m_fsm.GetCurrentState().OnUpdate(dt);
void wpnDebugSpam(string s)
void wpnDebugPrint(string s)
enum FSMTransition WeaponTransition
static bool IsWeaponLogEnable()
signalize mechanism manipulation
weapon finite state machine
bool SaveCurrentFSMState(ParamsWriteContext ctx)
bool ProcessEvent(WeaponEventBase e)
void OnAbort(WeaponEventBase e)
void OnExit(WeaponEventBase e)
void WeaponStateBase(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
internal state id used for load/restore
bool IsIdle()
idle state does not expect any animation events
bool IsWaitingForActionFinish()
WeaponStateBase m_parentState
weapon that this state relates to
bool LoadCurrentFSMState(ParamsReadContext ctx, int version)
ref WeaponFSM m_fsm
hierarchical parent state of this state (or null)
void OnSubMachineChanged(WeaponStateBase src, WeaponStateBase dst)
called when sub-machine has changed its state
void OnStateChanged(WeaponStateBase src, WeaponStateBase dst)
called on current state when state machine has changed its state
WeaponStateBase GetParentState()
int m_InternalID
nested state machine (or null)
void AddTransition(WeaponTransition t)
adds transition into m_fsm transition table
void SetParentState(WeaponStateBase parent)
allows construction of hierarchical state machine
void SetInternalStateID(int i)
void OnEntry(WeaponEventBase e)
represent weapon state base
Serializer ParamsReadContext
Serializer ParamsWriteContext
void Error(string err)
Messagebox with error message.