15 int m_InternalID = -1;
22 void SetParentState (
WeaponStateBase parent) { m_parentState = parent; }
28 bool HasFSM () {
return m_fsm != NULL; }
31 void SetInternalStateID (
int i) { m_InternalID = i; }
32 int GetInternalStateID () {
return m_InternalID; }
40 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugSpam(
"[wpnfsm] " +
Object.GetDebugName(m_weapon) +
" WeaponStateBase::SaveCurrentFSMState - idle state, skipping other substates"); }
41 return m_fsm.SaveCurrentFSMState(ctx);
46 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugSpam(
"[wpnfsm] " +
Object.GetDebugName(m_weapon) +
" WeaponStateBase::SaveCurrentFSMState - NOT idle state, saving full submachine state"); }
47 return m_fsm.SaveCurrentUnstableFSMState(ctx);
60 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugSpam(
"[wpnfsm] " +
Object.GetDebugName(m_weapon) +
" WeaponStateBase::LoadCurrentFSMState - idle state, skipping other substates"); }
61 if (m_fsm.LoadCurrentFSMState(ctx, version))
64 Error(
"[wpnfsm] " +
Object.GetDebugName(m_weapon) +
" WeaponStateBase::LoadCurrentFSMState - Cannot load stable state for weapon=" +
this);
69 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugSpam(
"[wpnfsm] " +
Object.GetDebugName(m_weapon) +
" WeaponStateBase::LoadCurrentFSMState - NOT idle state, loading full submachine state"); }
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.");
105 if (HasFSM() && !m_fsm.IsRunning())
107 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(m_weapon) +
" { " +
this.Type().ToString() +
" Has Sub-FSM! Starting submachine..."); }
119 void OnUpdate (
float dt)
121 if (HasFSM() && m_fsm.IsRunning())
122 m_fsm.GetCurrentState().OnUpdate(dt);
131 if (HasFSM() && m_fsm.IsRunning())
133 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(m_weapon) +
" OnAbort " +
this.Type().ToString() +
" Has Sub-FSM! Aborting submachine..."); }
152 bool IsWaitingForActionFinish () {
return HasFSM() && m_fsm.IsRunning() && m_fsm.GetCurrentState().IsWaitingForActionFinish(); }
158 bool IsIdle () {
return false; }
163 bool IsBoltOpen () {
return false; }