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);
94 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" adding transition to state without FSM. Configure FSM first.");
121 m_fsm.GetCurrentState().OnUpdate(
dt);
void wpnDebugSpam(string s)
void wpnDebugPrint(string s)
static bool IsWeaponLogEnable()
Serialization general interface. Serializer API works with:
signalize mechanism manipulation
weapon finite state machine
represent weapon state base
bool SaveCurrentFSMState(ParamsWriteContext ctx)
bool ProcessEvent(WeaponEventBase e)
void OnStateChanged(WeaponStateBase src, WeaponStateBase dst)
called on current state when state machine has changed its state
void OnAbort(WeaponEventBase e)
bool IsIdle()
idle state does not expect any animation events
void OnExit(WeaponEventBase e)
void WeaponStateBase(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
internal state id used for load/restore
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 SetParentState(WeaponStateBase parent)
allows construction of hierarchical state machine
WeaponStateBase GetParentState()
int m_InternalID
nested state machine (or null)
void OnSubMachineChanged(WeaponStateBase src, WeaponStateBase dst)
called when sub-machine has changed its state
void SetInternalStateID(int i)
void AddTransition(WeaponTransition t)
adds transition into m_fsm transition table
void OnEntry(WeaponEventBase e)
void Error(string err)
Messagebox with error message.