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()
Serialization general interface. Serializer API works with:
signalize mechanism manipulation
weapon finite state machine
represent weapon state base
bool IsIdle()
idle state does not expect any animation events
void SetInternalStateID(int i)
void OnEntry(WeaponEventBase e)
bool ProcessEvent(WeaponEventBase e)
void OnSubMachineChanged(WeaponStateBase src, WeaponStateBase dst)
called when sub-machine has changed its state
ref WeaponFSM m_fsm
hierarchical parent state of this state (or null)
WeaponStateBase GetParentState()
bool LoadCurrentFSMState(ParamsReadContext ctx, int version)
bool SaveCurrentFSMState(ParamsWriteContext ctx)
void SetParentState(WeaponStateBase parent)
allows construction of hierarchical state machine
WeaponStateBase m_parentState
weapon that this state relates to
bool IsWaitingForActionFinish()
void WeaponStateBase(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
internal state id used for load/restore
int m_InternalID
nested state machine (or null)
void OnAbort(WeaponEventBase e)
void AddTransition(WeaponTransition t)
adds transition into m_fsm transition table
void OnStateChanged(WeaponStateBase src, WeaponStateBase dst)
called on current state when state machine has changed its state
void OnExit(WeaponEventBase e)
void Error(string err)
Messagebox with error message.