Private Member Functions | |
| protected void | SetInternalID (WeaponStateBase state) |
| unique list of states in this machine (automation of save/load) | |
| override void | AddTransition (FSMTransition< WeaponStateBase, WeaponEventBase, WeaponActionBase, WeaponGuardBase > t) |
| adds transition into transition table As a side effect registers the state(s) into m_UniqueStates | |
| override protected ProcessEventResult | ProcessLocalTransition (FSMTransition< WeaponStateBase, WeaponEventBase, WeaponActionBase, WeaponGuardBase > t, WeaponEventBase e) |
| override protected ProcessEventResult | ProcessAbortTransition (FSMTransition< WeaponStateBase, WeaponEventBase, WeaponActionBase, WeaponGuardBase > t, WeaponEventBase e) |
| override WeaponStateBase | ProcessAbortEvent (WeaponEventBase e, out ProcessEventResult result) |
| override ProcessEventResult | ProcessEvent (WeaponEventBase e) |
| WeaponStateBase | FindStateForInternalID (int id) |
| retrieve base state that matches given internal id | |
| WeaponStableState | FindStableStateForID (int id) |
| load from database - reverse lookup for state from saved id | |
| protected bool | LoadAndSetCurrentFSMState (ParamsReadContext ctx, int version) |
| bool | LoadCurrentFSMState (ParamsReadContext ctx, int version) |
| load current state of fsm | |
| bool | LoadCurrentUnstableFSMState (ParamsWriteContext ctx, int version) |
| bool | SaveCurrentFSMState (ParamsWriteContext ctx) |
| save current state of fsm | |
| bool | SaveCurrentUnstableFSMState (ParamsWriteContext ctx) |
| void | ValidateAndRepair () |
| validate the state of the gun and repair if mismatch | |
| protected bool | Internal_ValidateAndRepair () |
| validate the state of the gun and repair if mismatch | |
| protected bool | ValidateAndRepairHelper (Weapon_Base weapon, string name, bool stateCondition, bool gunCondition, WeaponEventBase e1, WeaponEventBase e2, out WeaponStableState state) |
| protected void | OnFailThresholdBreached (Weapon weapon, string name, bool stateCondition, bool gunCondition) |
| protected WeaponStableState | ValidateAndRepairStateFinder (bool condition, WeaponEventBase e1, WeaponEventBase e2, WeaponStableState state) |
| bool | OnStoreLoad (ParamsReadContext ctx, int version) |
| load state of fsm | |
| int | GetCurrentStableStateID () |
| int | GetInternalStateID () |
| void | OnStoreSave (ParamsWriteContext ctx) |
| save state of fsm | |
| void | RandomizeFSMState (bool hasBullet, bool hasMagazine, bool isJammed) |
| Deprecated, use RandomizeFSMStateEx for better results. | |
| void | RandomizeFSMStateEx (array< MuzzleState > muzzleStates, bool hasMagazine, bool isJammed) |
| With the parameters given, selects a random suitable state for the FSM of the weapon @NOTE: It is better to use Weapon_Base.RandomizeFSMState instead of calling this one @WARNING: Weapon_Base.Synchronize call might be needed, if this method is called while clients are connected. | |
Private Attributes | |
| private int | m_SynchronizeAttempts |
| private int | m_LastSynchronizeTime |
| protected int | m_NextStateId = 0 |
| protected ref array< WeaponStateBase > | m_UniqueStates = new array<WeaponStateBase> |
| counter for InternalID: each state in a fsm is assigned an unique number | |
Static Private Attributes | |
| static private const int | MAX_SYNCHRONIZE_ATTEMPTS = 12 |
| static private const int | MIN_SYNCHRONIZE_INTERVAL = 3000 |
| static private const int | RESET_SYNCHRONIZE_THRESHOLD = 3600000 |
|
inlineprivate |
adds transition into transition table As a side effect registers the state(s) into m_UniqueStates
|
inlineprivate |
load from database - reverse lookup for state from saved id
| [in] | id | the id stored in database during save |
References WeaponStableState::GetCurrentStateID().
|
inlineprivate |
retrieve base state that matches given internal id
| [in] | id | the id stored in database during save |
References WeaponStateBase::GetInternalStateID().
|
inlineprivate |
References WeaponStableState::GetCurrentStateID(), and Print().
|
inlineprivate |
References WeaponStateBase::GetInternalStateID().
|
inlineprivate |
validate the state of the gun and repair if mismatch
References WeaponStableState::HasMagazine(), WeaponStableState::IsJammed(), WeaponStableState::IsRepairEnabled(), and m_State.
|
inlineprivate |
References Error(), LogManager::IsWeaponLogEnable(), m_State, Serializer::Read(), Start(), and wpnDebugPrint().
|
inlineprivate |
load current state of fsm
References LogManager::IsWeaponLogEnable(), m_State, and wpnDebugSpam().
|
inlineprivate |
References Error(), LogManager::IsWeaponLogEnable(), and wpnDebugSpam().
|
inlineprivate |
load state of fsm
References LogManager::IsWeaponLogEnable(), m_State, Print(), Serializer::Read(), Start(), and wpnDebugPrint().
|
inlineprivate |
save state of fsm
References LogManager::IsWeaponLogEnable(), wpnDebugSpamALot(), and Serializer::Write().
|
inlineprivate |
|
inlineprivate |
References fsmDebugPrint(), LogManager::IsInventoryHFSMLogEnable(), and m_State.
|
inlineprivate |
|
inlineprivate |
References fsmDebugPrint(), LogManager::IsInventoryHFSMLogEnable(), and m_State.
Deprecated, use RandomizeFSMStateEx for better results.
|
inlineprivate |
With the parameters given, selects a random suitable state for the FSM of the weapon @NOTE: It is better to use Weapon_Base.RandomizeFSMState instead of calling this one @WARNING: Weapon_Base.Synchronize call might be needed, if this method is called while clients are connected.
References ErrorEx, WeaponStableState::GetCurrentStateID(), WeaponStableState::HasMagazine(), INDEX_NOT_FOUND, WeaponStableState::IsJammed(), LogManager::IsWeaponLogEnable(), m_State, Math::RandomInt(), Start(), and wpnDebugPrint().
|
inlineprivate |
save current state of fsm
References Error(), WeaponStateBase::GetInternalStateID(), LogManager::IsWeaponLogEnable(), WeaponStateBase::SaveCurrentFSMState(), wpnDebugPrint(), and Serializer::Write().
|
inlineprivate |
|
inlineprivate |
unique list of states in this machine (automation of save/load)
References WeaponStateBase::GetInternalStateID(), and WeaponStateBase::SetInternalStateID().
|
inlineprivate |
validate the state of the gun and repair if mismatch
|
inlineprivate |
References ErrorEx, g_Game, LogManager::IsWeaponLogEnable(), m_State, name, Start(), and wpnDebugPrint().
|
inlineprivate |
|
private |
|
private |
|
private |
|
private |
counter for InternalID: each state in a fsm is assigned an unique number
|
staticprivate |
|
staticprivate |
|
staticprivate |