DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс HandStateBase

represent hand state base Подробнее...

Закрытые члены

override void OnEntry (HandEventBase e)
 
override void OnAbort (HandEventBase e)
 
override void OnExit (HandEventBase e)
 
override bool IsWaitingForActionFinish ()
 waiting for active animation action/actionType finish
 
void HandAnimatedForceSwapping (Man player=null, HandStateBase parent=null)
 
override void OnEntry (HandEventBase e)
 
override void OnAbort (HandEventBase e)
 
override void OnExit (HandEventBase e)
 
void HandAnimatedForceSwapping_Inst (Man player=null, HandStateBase parent=null)
 
override void OnEntry (HandEventBase e)
 
override void OnAbort (HandEventBase e)
 
override void OnExit (HandEventBase e)
 
void HandAnimatedMovingToAtt (Man player=null, HandStateBase parent=null)
 
override void OnEntry (HandEventBase e)
 
override void OnAbort (HandEventBase e)
 
override void OnExit (HandEventBase e)
 
void HandAnimatedSwapping (Man player=null, HandStateBase parent=null)
 
override void OnEntry (HandEventBase e)
 
override void OnAbort (HandEventBase e)
 
override void OnExit (HandEventBase e)
 
void HandAnimatedTakingFromAtt (Man player=null, HandStateBase parent=null)
 
override void OnEntry (HandEventBase e)
 
override void OnAbort (HandEventBase e)
 
override void OnExit (HandEventBase e)
 
void HandStartReplacingItemElsewhereWithNewInHands (Man player=NULL, HandStateBase parent=NULL)
 
override void OnEntry (HandEventBase e)
 
override void OnAbort (HandEventBase e)
 
override void OnExit (HandEventBase e)
 
override bool IsWaitingForActionFinish ()
 
void HandReplacingItemElsewhereWithNewInHands (Man player=NULL, HandStateBase parent=NULL)
 
void HandStartReplacingItemInHands (Man player=NULL, HandStateBase parent=NULL)
 
override void OnEntry (HandEventBase e)
 
override void OnAbort (HandEventBase e)
 
override void OnExit (HandEventBase e)
 
override bool IsWaitingForActionFinish ()
 
void HandReplacingItemInHands (Man player=NULL, HandStateBase parent=NULL)
 
override void OnEntry (HandEventBase e)
 
override void OnAbort (HandEventBase e)
 
override void OnExit (HandEventBase e)
 
void HandStableState (Man player=NULL, HandStateBase parent=NULL, int anim_state=-1)
 
void SyncAnimState ()
 
override void OnEntry (HandEventBase e)
 
override void OnUpdate (float dt)
 
override void OnAbort (HandEventBase e)
 
override void OnExit (HandEventBase e)
 
override bool IsIdle ()
 idle state does not expect any animation events
 
int GetCurrentStateID ()
 
bool HasEntityInHands ()
 query for entity in hands
 
void HandStartAction (Man player=NULL, HandStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 specific action sub-type
 
override void OnEntry (HandEventBase e)
 
override void OnExit (HandEventBase e)
 
override bool IsIdle ()
 
void HandStateBase (Man player=NULL, HandStateBase parent=NULL)
 nested state machine (or null)
 
void SetParentState (HandStateBase parent)
 allows construction of hierarchical state machine
 
HandStateBase GetParentState ()
 
bool HasFSM ()
 
HandFSM GetFSM ()
 
bool ProcessEvent (HandEventBase e)
 
void AddTransition (HandTransition t)
 adds transition into m_FSM transition table
 
void OnEntry (HandEventBase e)
 
void OnUpdate (float dt)
 
void OnAbort (HandEventBase e)
 
void OnExit (HandEventBase e)
 
bool IsWaitingForActionFinish ()
 
bool IsIdle ()
 
void OnSubMachineChanged (HandStateBase src, HandStateBase dst)
 called when sub-machine has changed its state
 
void OnStateChanged (HandStateBase src, HandStateBase dst)
 called on current state when state machine has changed its state
 

Закрытые данные

ref InventoryLocation m_Dst
 
ref InventoryLocation m_Src1 = null
 
ref InventoryLocation m_Src2 = null
 
ref InventoryLocation m_Dst1 = null
 
ref InventoryLocation m_Dst2 = null
 
ref HandStartHidingAnimated m_Start
 
ref HandAnimatedMoveToDst_W4T m_Show
 
ref HandAnimatedMoveToDst_W4T_Basic m_Hide
 
ref HandForceSwappingAnimated_Show m_Swap
 
EntityAI m_Entity
 
ref HandStartHidingAnimated m_Hide
 weapon to be taken
 
ref InventoryLocation m_ilEntity
 
ref HandSwappingAnimated_Show m_Show
 
ref HandTakingAnimated_Hide m_Hide
 
ref HandTakingAnimated_Show m_Show
 
ref HandStartReplacingItemElsewhereWithNewInHands m_Replacing
 
ref HandStartReplacingItemInHands m_Replacing
 
int m_AnimState
 
WeaponActions m_Action
 
int m_ActionType
 action to be played
 
Man m_Player
 
HandStateBase m_parentState
 entity that this state relates to
 
ref HandFSM m_FSM
 hierarchical parent state of this state (or null)
 

Подробное описание

represent hand state base

Class comes with entry/update/exit hooks that can be overriden in custom states

Конструктор(ы)

◆ HandStateBase()

void HandStateBase ( Man player = NULL,
HandStateBase parent = NULL )
inlineprivate

nested state machine (or null)

11{ m_Player = player; m_parentState = parent; }
Man m_Player
Definition HandStateBase.c:8
HandStateBase m_parentState
entity that this state relates to
Definition HandStateBase.c:9
Definition EntityAI.c:95

Перекрестные ссылки m_parentState и m_Player.

Методы

◆ AddTransition()

AddTransition ( HandTransition t)
inlineprivate

adds transition into m_FSM transition table

36 {
37 if (HasFSM())
38 m_FSM.AddTransition(t);
39 else
40 Error("[hndfsm] adding transition to state without FSM. Configure FSM first.");
41 }
bool HasFSM()
Definition HandStateBase.c:22
ref HandFSM m_FSM
hierarchical parent state of this state (or null)
Definition HandStateBase.c:10
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

Перекрестные ссылки Error(), HasFSM() и m_FSM.

◆ GetCurrentStateID()

int GetCurrentStateID ( )
inlineprivate
36{ return 0; }

◆ GetFSM()

HandFSM GetFSM ( )
inlineprivate
23{ return m_FSM; }

Перекрестные ссылки m_FSM.

◆ GetParentState()

GetParentState ( )
inlineprivate
Возвращает
state that owns this sub-state (or null if plain state)
20{ return m_parentState; }

Перекрестные ссылки m_parentState.

◆ HandAnimatedForceSwapping()

void HandAnimatedForceSwapping ( Man player = null,
HandStateBase parent = null )
inlineprivate
122 {
123 // setup nested state machine
124 m_Start = new HandStartHidingAnimated(player, this, WeaponActions.HIDE, -1);
127
128 // events:
129 HandEventBase _fin_ = new HandEventHumanCommandActionFinished;
130 HandEventBase _AEh_ = new HandAnimEventChanged;
131 HandEventBase __Xd_ = new HandEventDestroyed;
132
133 m_FSM = new HandFSM(this); // @NOTE: set owner of the submachine fsm
134
135 m_FSM.AddTransition(new HandTransition( m_Start, _AEh_, m_Hide ));
136 m_FSM.AddTransition(new HandTransition( m_Hide, _AEh_, m_Show )); // no animation in Hide step
137 m_FSM.AddTransition(new HandTransition( m_Show, _fin_, null ));
138 m_FSM.AddTransition(new HandTransition( m_Hide, _fin_, null ));
139 m_FSM.AddTransition(new HandTransition( m_Show, __Xd_, null ));
140 m_FSM.AddTransition(new HandTransition( m_Hide, __Xd_, null ));
141
142 m_FSM.SetInitialState(m_Start);
143 }
FSMTransition< HandStateBase, HandEventBase, HandActionBase, HandGuardBase > HandTransition
Definition HandFSM.c:28
Abstracted event, not to be used, only inherited.
Definition Hand_Events.c:209
Hand finite state machine.
ref HandStartHidingAnimated m_Start
Definition HandAnimatedForceSwapping.c:117
ref HandAnimatedMoveToDst_W4T_Basic m_Hide
Definition HandAnimatedForceSwapping.c:119
ref HandAnimatedMoveToDst_W4T m_Show
Definition HandAnimatedForceSwapping.c:118
WeaponActions
actions
Definition human.c:816

◆ HandAnimatedForceSwapping_Inst()

void HandAnimatedForceSwapping_Inst ( Man player = null,
HandStateBase parent = null )
inlineprivate
246 {
247 // setup nested state machine
248 m_Start = new HandStartHidingAnimated(player, this, WeaponActions.HIDE, -1);
250
251 // events:
252 HandEventBase _fin_ = new HandEventHumanCommandActionFinished;
253 HandEventBase _AEh_ = new HandAnimEventChanged;
254 HandEventBase __Xd_ = new HandEventDestroyed;
255
256 m_FSM = new HandFSM(this); // @NOTE: set owner of the submachine fsm
257
258 m_FSM.AddTransition(new HandTransition( m_Start, _AEh_, m_Swap ));
259 m_FSM.AddTransition(new HandTransition( m_Swap, _fin_, null ));
260 m_FSM.AddTransition(new HandTransition( m_Swap, __Xd_, null ));
261
262 m_FSM.SetInitialState(m_Start);
263 }
Definition HandAnimatedSwapping.c:2
ref HandForceSwappingAnimated_Show m_Swap
Definition HandAnimatedForceSwapping.c:243

◆ HandAnimatedMovingToAtt()

void HandAnimatedMovingToAtt ( Man player = null,
HandStateBase parent = null )
inlineprivate
87 {
88 // setup nested state machine
89 m_Hide = new HandStartHidingAnimated(player, this, WeaponActions.HIDE, -1);
91
92 // events:
93 HandEventBase _fin_ = new HandEventHumanCommandActionFinished;
94 HandEventBase _AEh_ = new HandAnimEventChanged;
95
96 m_FSM = new HandFSM(this); // @NOTE: set owner of the submachine fsm
97
98 m_FSM.AddTransition(new HandTransition( m_Hide, _AEh_, m_Show ));
99 m_FSM.AddTransition(new HandTransition( m_Show, _fin_, null ));
100
101 m_FSM.SetInitialState(m_Hide);
102 }

◆ HandAnimatedSwapping()

void HandAnimatedSwapping ( Man player = null,
HandStateBase parent = null )
inlineprivate
17 {
18 // setup nested state machine
19 m_Hide = new HandStartHidingAnimated(player, this, WeaponActions.HIDE, -1);
21
22 // events:
23 HandEventBase _fin_ = new HandEventHumanCommandActionFinished;
24 HandEventBase _AEh_ = new HandAnimEventChanged;
25
26 m_FSM = new HandFSM(this); // @NOTE: set owner of the submachine fsm
27
28 m_FSM.AddTransition(new HandTransition( m_Hide, _AEh_, m_Show ));
29 m_FSM.AddTransition(new HandTransition( m_Show, _fin_, null ));
30
31 m_FSM.SetInitialState(m_Hide);
32 }

◆ HandAnimatedTakingFromAtt()

void HandAnimatedTakingFromAtt ( Man player = null,
HandStateBase parent = null )
inlineprivate
75 {
76 // setup nested state machine
78 m_Show = new HandTakingAnimated_Show(player, this, WeaponActions.SHOW, -1);
79
80 // events:
81 HandEventBase _fin_ = new HandEventHumanCommandActionFinished;
82 HandEventBase _AEh_ = new HandAnimEventChanged;
83 HandEventBase __Xd_ = new HandEventDestroyed;
84
85 m_FSM = new HandFSM(this); // @NOTE: set owner of the submachine fsm
86
87 m_FSM.AddTransition(new HandTransition( m_Hide, _AEh_, m_Show ));
88 m_FSM.AddTransition(new HandTransition( m_Hide, __Xd_, null ));
89 m_FSM.AddTransition(new HandTransition( m_Show, _fin_, null ));
90 m_FSM.AddTransition(new HandTransition( m_Show, __Xd_, null ));
91
92 m_FSM.SetInitialState(m_Hide);
93 }

◆ HandReplacingItemElsewhereWithNewInHands()

void HandReplacingItemElsewhereWithNewInHands ( Man player = NULL,
HandStateBase parent = NULL )
inlineprivate
43 {
44 // setup nested state machine
46
47 // events:
48 HandEventBase _fin_ = new HandEventHumanCommandActionFinished;
49
50 m_FSM = new HandFSM(this); // @NOTE: set owner of the submachine fsm
51
52 m_FSM.AddTransition(new HandTransition( m_Replacing, _fin_, NULL ));
53
54 m_FSM.SetInitialState(m_Replacing);
55 }
ref HandStartReplacingItemElsewhereWithNewInHands m_Replacing
Definition HandReplacingItemElsewhereWithNewInHands.c:40
void HandStartReplacingItemElsewhereWithNewInHands(Man player=NULL, HandStateBase parent=NULL)
Definition HandReplacingItemElsewhereWithNewInHands.c:3

Перекрестные ссылки HandStartReplacingItemElsewhereWithNewInHands().

◆ HandReplacingItemInHands()

void HandReplacingItemInHands ( Man player = NULL,
HandStateBase parent = NULL )
inlineprivate
52 {
53 // setup nested state machine
55
56 // events:
57 HandEventBase _fin_ = new HandEventHumanCommandActionFinished;
58
59 m_FSM = new HandFSM(this); // @NOTE: set owner of the submachine fsm
60
61 m_FSM.AddTransition(new HandTransition( m_Replacing, _fin_, NULL ));
62
63 m_FSM.SetInitialState(m_Replacing);
64 }
void HandStartReplacingItemInHands(Man player=NULL, HandStateBase parent=NULL)
Definition HandReplacingItemInHands.c:3

Перекрестные ссылки HandStartReplacingItemInHands().

◆ HandStableState()

void HandStableState ( Man player = NULL,
HandStateBase parent = NULL,
int anim_state = -1 )
inlineprivate
int m_AnimState
Definition HandStableState.c:6

◆ HandStartAction()

void HandStartAction ( Man player = NULL,
HandStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

specific action sub-type

10 {
13 }
int m_ActionType
action to be played
Definition HandStartAction.c:7
WeaponActions m_Action
Definition HandStartAction.c:6

Перекрестные ссылки m_Action.

◆ HandStartReplacingItemElsewhereWithNewInHands()

void HandStartReplacingItemElsewhereWithNewInHands ( Man player = NULL,
HandStateBase parent = NULL )
inlineprivate
4 { }

Используется в HandReplacingItemElsewhereWithNewInHands().

◆ HandStartReplacingItemInHands()

void HandStartReplacingItemInHands ( Man player = NULL,
HandStateBase parent = NULL )
inlineprivate
4 { }

Используется в HandReplacingItemInHands().

◆ HasEntityInHands()

bool HasEntityInHands ( )
inlineprivate

query for entity in hands

39{ return false; }

◆ HasFSM()

bool HasFSM ( )
inlineprivate
22{ return m_FSM != NULL; }

Перекрестные ссылки m_FSM.

Используется в AddTransition(), IsWaitingForActionFinish(), OnAbort(), OnEntry(), OnUpdate() и ProcessEvent().

◆ IsIdle() [1/3]

IsIdle ( )
inlineprivate

idle state does not expect any animation events

Возвращает
true if this state is idle
34{ return true; }

◆ IsIdle() [2/3]

override bool IsIdle ( )
inlineprivate
54{ return false; }

◆ IsIdle() [3/3]

bool IsIdle ( )
inlineprivate
121{ return false; }

◆ IsWaitingForActionFinish() [1/4]

IsWaitingForActionFinish ( )
inlineprivate

waiting for active animation action/actionType finish

Возвращает
true if this state is waiting for finish signal
51{ return true; }

◆ IsWaitingForActionFinish() [2/4]

override bool IsWaitingForActionFinish ( )
inlineprivate
34{ return true; }

◆ IsWaitingForActionFinish() [3/4]

override bool IsWaitingForActionFinish ( )
inlineprivate
43{ return true; }

◆ IsWaitingForActionFinish() [4/4]

bool IsWaitingForActionFinish ( )
inlineprivate
115{ return HasFSM() && m_FSM.IsRunning() && m_FSM.GetCurrentState().IsWaitingForActionFinish(); }

Перекрестные ссылки HasFSM() и m_FSM.

◆ OnAbort() [1/11]

override void OnAbort ( HandEventBase e)
inlineprivate
40 {
41 m_Dst = null;
42 super.OnAbort(e);
43 }
ref InventoryLocation m_Dst
Definition HandAnimatedForceSwapping.c:5

◆ OnAbort() [2/11]

override void OnAbort ( HandEventBase e)
inlineprivate
187 {
188 if ( !GetGame().IsDedicatedServer())
189 {
190 if (m_Dst1)
191 {
192 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
193 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
194 }
195 }
196 else
197 {
198 if (m_Dst1)
199 {
200 GetGame().ClearJuncture(e.m_Player, m_Dst1.GetItem());
201 GetGame().ClearJuncture(e.m_Player, m_Dst2.GetItem());
202 }
203 }
204
205 m_Src1 = null;
206 m_Src2 = null;
207 m_Dst1 = null;
208 m_Dst2 = null;
209
210 super.OnAbort(e);
211 }
ref InventoryLocation m_Src2
Definition HandAnimatedForceSwapping.c:113
ref InventoryLocation m_Dst1
Definition HandAnimatedForceSwapping.c:114
ref InventoryLocation m_Dst2
Definition HandAnimatedForceSwapping.c:115
ref InventoryLocation m_Src1
Definition HandAnimatedForceSwapping.c:112
proto native CGame GetGame()

Перекрестные ссылки GetGame().

◆ OnAbort() [3/11]

override void OnAbort ( HandEventBase e)
inlineprivate
309 {
310 if ( !GetGame().IsDedicatedServer())
311 {
312 if (m_Dst1)
313 {
314 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
315 }
316 if (m_Dst2)
317 {
318 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
319 }
320 }
321 else
322 {
323 if (m_Dst1)
324 {
325 GetGame().ClearJuncture(e.m_Player, m_Dst1.GetItem());
326 }
327 if (m_Dst2)
328 {
329 GetGame().ClearJuncture(e.m_Player, m_Dst2.GetItem());
330 }
331 }
332
333 m_Src1 = null;
334 m_Src2 = null;
335 m_Dst1 = null;
336 m_Dst2 = null;
337
338 super.OnAbort(e);
339 }

Перекрестные ссылки GetGame().

◆ OnAbort() [4/11]

override void OnAbort ( HandEventBase e)
inlineprivate
123 {
124 if ( !GetGame().IsDedicatedServer())
125 {
126 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Entity, m_ilEntity);
127 }
128 else
129 {
130 GetGame().ClearJunctureEx(e.m_Player, m_Entity);
131 }
132
133 m_Entity = null;
135
136 super.OnAbort(e);
137 }
ref InventoryLocation m_ilEntity
Definition HandAnimatedMovingToAtt.c:84
EntityAI m_Entity
Definition HandAnimatedMovingToAtt.c:79

Перекрестные ссылки GetGame() и m_Entity.

◆ OnAbort() [5/11]

override void OnAbort ( HandEventBase e)
inlineprivate
63 {
64 if ( !GetGame().IsDedicatedServer())
65 {
66 if (m_Dst2)
67 {
68 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
69 }
70 if (m_Dst1)
71 {
72 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
73 }
74 }
75 else
76 {
77 if (m_Dst2)
78 {
79 GetGame().ClearJuncture(e.m_Player, m_Dst2.GetItem());
80 }
81 if (m_Dst1)
82 {
83 GetGame().ClearJuncture(e.m_Player, m_Dst1.GetItem());
84 }
85 }
86
87 m_Src1 = null;
88 m_Src2 = null;
89 m_Dst1 = null;
90 m_Dst2 = null;
91
92 super.OnAbort(e);
93 }

Перекрестные ссылки GetGame().

◆ OnAbort() [6/11]

override void OnAbort ( HandEventBase e)
inlineprivate
110 {
111 #ifdef ENABLE_LOGGING
113 {
114 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "OnAbort", e.m_Player.ToString() );
115 }
116 #endif
117 if (m_Dst)
118 {
119 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst.GetItem(), m_Dst);
120 if ( GetGame().IsServer() )
121 GetGame().ClearJuncture(e.m_Player, m_Dst.GetItem());
122 }
123 m_Dst = null;
124
125 super.OnAbort(e);
126 }
Definition Debug.c:14
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:161
Definition Debug.c:600
static bool IsInventoryHFSMLogEnable()
Definition Debug.c:674

Перекрестные ссылки GetGame(), Debug::InventoryHFSMLog() и LogManager::IsInventoryHFSMLogEnable().

◆ OnAbort() [7/11]

override void OnAbort ( HandEventBase e)
inlineprivate
25 {
26 super.OnAbort(e);
27 }

◆ OnAbort() [8/11]

override void OnAbort ( HandEventBase e)
inlineprivate
34 {
35 super.OnAbort(e);
36 }

◆ OnAbort() [9/11]

override void OnAbort ( HandEventBase e)
inlineprivate
72 {
73 super.OnAbort(e);
74 }

◆ OnAbort() [10/11]

override void OnAbort ( HandEventBase e)
inlineprivate
25 {
26 super.OnAbort(e);
27 }

◆ OnAbort() [11/11]

void OnAbort ( HandEventBase e)
inlineprivate
92 {
93 if (HasFSM() && m_FSM.IsRunning())
94 {
95 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[hndfsm] OnAbort " + this.Type().ToString() + " Has Sub-FSM! Aborting submachine...");
96 m_FSM.Abort(e);
97 }
98 //Debug.InventoryHFSMLog("ABORTED " + e.m_Player.GetSimulationTimeStamp(), ""/*typename.EnumToString(HandEventID, GetEventID()) */, "n/a", "OnAbort", m_Player.ToString() );
99 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[hndfsm] } " + Object.GetDebugName(e.m_Player) + " STS = " + e.m_Player.GetSimulationTimeStamp() + " ABORTED " + this.Type().ToString());
100 }
proto string ToString()
void hndDebugPrint(string s)
Definition HandFSM.c:1
string Type
Definition JsonDataContaminatedArea.c:11
Definition ObjectTyped.c:2

Перекрестные ссылки HasFSM(), hndDebugPrint(), LogManager::IsInventoryHFSMLogEnable(), m_FSM, ToString() и Type.

◆ OnEntry() [1/12]

override void OnEntry ( HandEventBase e)
inlineprivate
8 {
9 Man player = e.m_Player;
10 if (m_Dst && m_Dst.IsValid())
11 {
12 EntityAI item = m_Dst.GetItem();
14 if (item.GetInventory().GetCurrentInventoryLocation(src))
15 {
17 {
18 player.OnItemInHandsChanged();
19 }
20 else
21 {
22 #ifdef ENABLE_LOGGING
24 {
25 Debug.InventoryHFSMLog("[hndfsm] HandAnimatedMoveToDst_W4T_Basic - not allowed");
26 }
27 #endif
28 }
29 }
30 else
31 Error("[hndfsm] " + Object.GetDebugName(e.m_Player) + " STS = " + e.m_Player.GetSimulationTimeStamp() + " HandAnimatedMoveToDst_W4T_Basic - item " + item + " has no Inventory or Location, inv=" + item.GetInventory());
32 }
33 else
34 Error("[hndfsm] HandAnimatedMoveToDst_W4T_Basic - event has no valid m_Dst");
35
36 super.OnEntry(e);
37 }
Definition Building.c:6
script counterpart to engine's class Inventory
Definition Inventory.c:79
static proto native bool LocationSyncMoveEntity(notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
synchronously removes item from current inventory location and adds it to destination no anims involv...
InventoryLocation.
Definition InventoryLocation.c:29

Перекрестные ссылки Error(), Debug::InventoryHFSMLog(), LogManager::IsInventoryHFSMLogEnable() и GameInventory::LocationSyncMoveEntity().

◆ OnEntry() [2/12]

override void OnEntry ( HandEventBase e)
inlineprivate
146 {
147 HandEventForceSwap efs = HandEventForceSwap.Cast(e);
148 if (efs)
149 {
150 if ( efs.GetSrc().GetType() == InventoryLocationType.HANDS )
151 {
152 m_Start.m_ActionType = efs.m_AnimationID;
153
154 m_Src1 = efs.GetSrc();
155 m_Src2 = efs.m_Src2;
156 m_Dst1 = efs.GetDst();
157 m_Dst2 = efs.m_Dst2;
158
159 m_Show.m_ActionType = efs.m_Animation2ID;
160 }
161 else
162 {
163 m_Start.m_ActionType = efs.m_Animation2ID;
164
165 m_Src1 = efs.m_Src2;
166 m_Src2 = efs.GetSrc();
167 m_Dst1 = efs.m_Dst2;
168 m_Dst2 = efs.GetDst();
169
170 m_Show.m_ActionType = efs.m_AnimationID;
171 }
172
173 m_Hide.m_Dst = m_Dst1;
174 m_Show.m_Dst = m_Dst2;
175
176 if (!GetGame().IsDedicatedServer())
177 {
178 e.m_Player.GetHumanInventory().AddInventoryReservationEx(m_Dst1.GetItem(), m_Dst1, GameInventory.c_InventoryReservationTimeoutShortMS);
179 e.m_Player.GetHumanInventory().AddInventoryReservationEx(m_Dst2.GetItem(), m_Dst2, GameInventory.c_InventoryReservationTimeoutShortMS);
180 }
181 }
182
183 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
184 }
InventoryLocationType
types of Inventory Location
Definition InventoryLocation.c:4
const int c_InventoryReservationTimeoutShortMS
Definition Inventory.c:713

Перекрестные ссылки GameInventory::c_InventoryReservationTimeoutShortMS, GetGame(), m_Dst1 и m_Dst2.

◆ OnEntry() [3/12]

override void OnEntry ( HandEventBase e)
inlineprivate
266 {
267 HandEventForceSwap efs = HandEventForceSwap.Cast(e);
268 if (efs)
269 {
270 if ( efs.GetSrc().GetType() == InventoryLocationType.HANDS )
271 {
272 m_Start.m_ActionType = efs.m_AnimationID;
273
274 m_Src1 = efs.GetSrc();
275 m_Src2 = efs.m_Src2;
276 m_Dst1 = efs.GetDst();
277 m_Dst2 = efs.m_Dst2;
278
279 m_Swap.m_ActionType = efs.m_Animation2ID;
280 }
281 else
282 {
283 m_Start.m_ActionType = efs.m_Animation2ID;
284
285 m_Src1 = efs.m_Src2;
286 m_Src2 = efs.GetSrc();
287 m_Dst1 = efs.m_Dst2;
288 m_Dst2 = efs.GetDst();
289
290 m_Swap.m_ActionType = efs.m_AnimationID;
291 }
292
293 m_Swap.m_Src1 = m_Src1;
294 m_Swap.m_Dst1 = m_Dst1;
295 m_Swap.m_Src2 = m_Src2;
296 m_Swap.m_Dst2 = m_Dst2;
297
298 if (!GetGame().IsDedicatedServer())
299 {
300 e.m_Player.GetHumanInventory().AddInventoryReservationEx(m_Dst1.GetItem(), m_Dst1, GameInventory.c_InventoryReservationTimeoutShortMS);
301 e.m_Player.GetHumanInventory().AddInventoryReservationEx(m_Dst2.GetItem(), m_Dst2, GameInventory.c_InventoryReservationTimeoutShortMS);
302 }
303 }
304
305 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
306 }

Перекрестные ссылки GameInventory::c_InventoryReservationTimeoutShortMS, GetGame(), m_Dst1, m_Dst2, m_Src1 и m_Src2.

◆ OnEntry() [4/12]

override void OnEntry ( HandEventBase e)
inlineprivate
105 {
106 m_Entity = e.GetSrcEntity();
107 HandEventMoveTo ev_move = HandEventMoveTo.Cast(e);
108 if (ev_move)
109 {
110 m_Show.m_Dst = ev_move.GetDst();
111 m_Hide.m_ActionType = ev_move.GetAnimationID();
112 m_Show.m_ActionType = ev_move.GetAnimationID();
113
114 m_ilEntity = m_Show.m_Dst;
115
116 e.m_Player.GetHumanInventory().AddInventoryReservationEx(m_Entity, m_ilEntity, GameInventory.c_InventoryReservationTimeoutShortMS);
117 }
118
119 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
120 }

Перекрестные ссылки GameInventory::c_InventoryReservationTimeoutShortMS и m_Entity.

◆ OnEntry() [5/12]

override void OnEntry ( HandEventBase e)
inlineprivate
35 {
37 if (es)
38 {
39 m_Src1 = es.GetSrc();
40 m_Src2 = es.m_Src2;
41 m_Dst1 = es.GetDst();
42 m_Dst2 = es.m_Dst2;
43
44 m_Show.m_Src1 = m_Src1;
45 m_Show.m_Src2 = m_Src2;
46 m_Show.m_Dst1 = m_Dst1;
47 m_Show.m_Dst2 = m_Dst2;
48
49 m_Hide.m_ActionType = es.m_AnimationID;
50 m_Show.m_ActionType = es.m_Animation2ID;
51
52 if (!GetGame().IsDedicatedServer())
53 {
54 e.m_Player.GetHumanInventory().AddInventoryReservationEx(m_Dst2.GetItem(), m_Dst2, GameInventory.c_InventoryReservationTimeoutShortMS);
55 e.m_Player.GetHumanInventory().AddInventoryReservationEx(m_Dst1.GetItem(), m_Dst1, GameInventory.c_InventoryReservationTimeoutShortMS);
56 }
57 }
58
59 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
60 }
Definition Hand_Events.c:679

Перекрестные ссылки GameInventory::c_InventoryReservationTimeoutShortMS, GetGame(), m_Dst1, m_Dst2, m_Src1 и m_Src2.

◆ OnEntry() [6/12]

override void OnEntry ( HandEventBase e)
inlineprivate
96 {
97 m_Dst = e.GetDst();
98 m_Show.m_Src = e.GetSrc();
99 m_Show.m_Dst = e.GetDst();
100
101 m_Hide.m_ActionType = e.GetAnimationID();
102 m_Show.m_ActionType = e.GetAnimationID();
103
104 e.m_Player.GetHumanInventory().AddInventoryReservationEx(m_Dst.GetItem(), m_Dst, GameInventory.c_InventoryReservationTimeoutShortMS);
105
106 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
107 }

Перекрестные ссылки GameInventory::c_InventoryReservationTimeoutShortMS.

◆ OnEntry() [7/12]

override void OnEntry ( HandEventBase e)
inlineprivate
7 {
8 super.OnEntry(e);
9
10 Man player = e.m_Player;
12 if (edr)
13 {
14 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[hndfsm] HandStartReplacingItemElsewhereWithNewInHands about to execute lambda");
15
17 edr.m_Lambda.Execute(inv);
18 return;
19 }
20 else
21 Error("[hndfsm] HandStartReplacingItemElsewhereWithNewInHands - not a HandEvenReplaceWithNewBase event");
22 }
Definition Hand_Events.c:768
HumanInventory... with FSM (synchronous, no anims)
Definition HumanInventoryWithFSM.c:6

Перекрестные ссылки Error(), hndDebugPrint() и LogManager::IsInventoryHFSMLogEnable().

◆ OnEntry() [8/12]

override void OnEntry ( HandEventBase e)
inlineprivate
7 {
8 super.OnEntry(e);
9
10 Man player = e.m_Player;
11 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
12
14 if (itemInHands.GetInventory().GetCurrentInventoryLocation(src))
15 {
17 if (edr)
18 {
19 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[hndfsm] HandStartReplacingItemInHands about to execute lambda");
20
22 edr.m_Lambda.Execute(inv);
23 //player.GetItemAccessor().OnItemInHandsChanged();
24 return;
25 }
26 else
27 Error("[hndfsm] HandStartReplacingItemInHands - not a HandEventDestroyAndReplaceWithNew event");
28 }
29 else
30 Error("[hndfsm] HandStartReplacingItemInHands - itemInHands has no InventoryLocation");
31 }
Definition Hand_Events.c:773

Перекрестные ссылки Error(), hndDebugPrint() и LogManager::IsInventoryHFSMLogEnable().

◆ OnEntry() [9/12]

override void OnEntry ( HandEventBase e)
inlineprivate
67 {
68 super.OnEntry(e);
69 }

◆ OnEntry() [10/12]

override void OnEntry ( HandEventBase e)
inlineprivate
13 {
14 super.OnEntry(e);
16
17 //m_weapon.OnStableStateEntry();
18 }
void SyncAnimState()
Definition HandStableState.c:10

Перекрестные ссылки SyncAnimState().

◆ OnEntry() [11/12]

override void OnEntry ( HandEventBase e)
inlineprivate
16 {
17 super.OnEntry(e);
18
19 if (e.m_Player)
20 {
21 HumanCommandWeapons hcw = e.m_Player.GetCommandModifier_Weapons();
22 if (hcw)
23 {
24 if (m_ActionType == -1)
25 {
26 hcw.StartAction(-1, -1);
27 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("HCW: " + Object.GetDebugName(e.m_Player) + " STS = " + e.m_Player.GetSimulationTimeStamp() + " playing A=-1 AT=-1 fini=" + hcw.IsActionFinished());
28 }
29 else
30 {
31 hcw.StartAction(m_Action, m_ActionType);
32
33 if (hcw.GetRunningAction() == m_Action && hcw.GetRunningActionType() == m_ActionType)
34 {
35 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("HCW: " + Object.GetDebugName(e.m_Player) + " STS = " + e.m_Player.GetSimulationTimeStamp() + " playing A=" + typename.EnumToString(WeaponActions, m_Action) + " AT=" + WeaponActionTypeToString(m_Action, m_ActionType) + " fini=" + hcw.IsActionFinished());
36 }
37 else
38 Error("HCW: NOT playing A=" + typename.EnumToString(WeaponActions, m_Action) + " AT=" + WeaponActionTypeToString(m_Action, m_ActionType) + " fini=" + hcw.IsActionFinished());
39 }
40 }
41 else
42 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("---: remote playing A=" + typename.EnumToString(WeaponActions, m_Action) + " AT=" + WeaponActionTypeToString(m_Action, m_ActionType));
43 }
44 else
45 {
46 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("---: warning, no player wants to play A=" + typename.EnumToString(WeaponActions, m_Action) + " AT=" + WeaponActionTypeToString(m_Action, m_ActionType));
47 }
48 }
Definition human.c:994
string WeaponActionTypeToString(int A, int AT)
Definition human.c:943

Перекрестные ссылки Error(), hndDebugPrint(), LogManager::IsInventoryHFSMLogEnable(), m_Action и WeaponActionTypeToString().

◆ OnEntry() [12/12]

void OnEntry ( HandEventBase e)
inlineprivate
50 {
51 if (HasFSM() && !m_FSM.IsRunning())
52 {
53 if (e)
54 {
55 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[hndfsm] { " + Object.GetDebugName(e.m_Player) + " STS = " + e.m_Player.GetSimulationTimeStamp() + " " + this.Type().ToString() + " Has Sub-FSM! Starting submachine...");
56 }
57 else
58 {
59 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[hndfsm] { " + this.Type().ToString() + " Has Sub-FSM! Starting submachine...");
60 }
61 m_FSM.Start(e);
62 }
63 else
64 {
65 if (e)
66 {
67 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[hndfsm] { " + Object.GetDebugName(e.m_Player) + " STS = " + e.m_Player.GetSimulationTimeStamp() + " " + this.Type().ToString());
68 }
69 else
70 {
71 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[hndfsm] { " + this.Type().ToString());
72 }
73 }
74 }

Перекрестные ссылки HasFSM(), hndDebugPrint(), LogManager::IsInventoryHFSMLogEnable(), m_FSM, ToString() и Type.

◆ OnExit() [1/12]

override void OnExit ( HandEventBase e)
inlineprivate
46 {
47 m_Dst = null;
48 super.OnExit(e);
49 }

◆ OnExit() [2/12]

override void OnExit ( HandEventBase e)
inlineprivate
214 {
215 if ( !GetGame().IsDedicatedServer())
216 {
217 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
218 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
219 }
220 else
221 {
222 GetGame().ClearJuncture(e.m_Player, m_Dst1.GetItem());
223 GetGame().ClearJuncture(e.m_Player, m_Dst2.GetItem());
224 }
225
226 m_Src1 = null;
227 m_Src2 = null;
228 m_Dst1 = null;
229 m_Dst2 = null;
230
231 super.OnExit(e);
232 }

Перекрестные ссылки GetGame().

◆ OnExit() [3/12]

override void OnExit ( HandEventBase e)
inlineprivate
342 {
343 if ( !GetGame().IsDedicatedServer())
344 {
345 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
346 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
347 }
348 else
349 {
350 GetGame().ClearJuncture(e.m_Player, m_Dst1.GetItem());
351 GetGame().ClearJuncture(e.m_Player, m_Dst2.GetItem());
352 }
353
354 m_Src1 = null;
355 m_Src2 = null;
356 m_Dst1 = null;
357 m_Dst2 = null;
358
359 super.OnExit(e);
360 }

Перекрестные ссылки GetGame().

◆ OnExit() [4/12]

override void OnExit ( HandEventBase e)
inlineprivate
140 {
141 if ( !GetGame().IsDedicatedServer())
142 {
143 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Entity, m_ilEntity);
144 }
145
146 m_Entity = null;
148
149 super.OnExit(e);
150 }

Перекрестные ссылки GetGame() и m_Entity.

◆ OnExit() [5/12]

override void OnExit ( HandEventBase e)
inlineprivate
96 {
97 if ( !GetGame().IsDedicatedServer())
98 {
99 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
100 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst1.GetItem(), m_Dst1);
101 }
102
103 m_Src1 = null;
104 m_Src2 = null;
105 m_Dst1 = null;
106 m_Dst2 = null;
107
108 super.OnExit(e);
109 }

Перекрестные ссылки GetGame().

◆ OnExit() [6/12]

override void OnExit ( HandEventBase e)
inlineprivate
129 {
130 e.m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst.GetItem(), m_Dst);
131 m_Dst = null;
132
133 super.OnExit(e);
134 }

◆ OnExit() [7/12]

override void OnExit ( HandEventBase e)
inlineprivate
30 {
31 super.OnExit(e);
32 }

◆ OnExit() [8/12]

override void OnExit ( HandEventBase e)
inlineprivate
39 {
40 super.OnExit(e);
41 }

◆ OnExit() [9/12]

override void OnExit ( HandEventBase e)
inlineprivate
77 {
78 super.OnExit(e);
79 }

◆ OnExit() [10/12]

override void OnExit ( HandEventBase e)
inlineprivate
29 {
30 //m_weapon.ResetWeaponAnimState();
31 super.OnExit(e);
32 }

◆ OnExit() [11/12]

override void OnExit ( HandEventBase e)
inlineprivate
50 {
51 super.OnExit(e);
52 }

◆ OnExit() [12/12]

void OnExit ( HandEventBase e)
inlineprivate
107 {
108 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[hndfsm] } " + Object.GetDebugName(e.m_Player) + " STS = " + e.m_Player.GetSimulationTimeStamp() + " " + this.Type().ToString());
109 }

Перекрестные ссылки hndDebugPrint() и LogManager::IsInventoryHFSMLogEnable().

◆ OnStateChanged()

OnStateChanged ( HandStateBase src,
HandStateBase dst )
inlineprivate

called on current state when state machine has changed its state

Аргументы
[in]srcfrom state (previous)
[in]dstto state (current)
136 {
137 m_Player.GetHumanInventory().OnHandsStateChanged(src, dst);
138 }

Перекрестные ссылки m_Player.

◆ OnSubMachineChanged()

OnSubMachineChanged ( HandStateBase src,
HandStateBase dst )
inlineprivate

called when sub-machine has changed its state

Аргументы
[in]srcfrom state (previous)
[in]dstto state (current)
128{ }

◆ OnUpdate() [1/2]

override void OnUpdate ( float dt)
inlineprivate
20 {
21 super.OnUpdate(dt);
23 }

Перекрестные ссылки SyncAnimState().

◆ OnUpdate() [2/2]

void OnUpdate ( float dt)
inlineprivate
82 {
83 if (HasFSM() && m_FSM.IsRunning())
84 m_FSM.GetCurrentState().OnUpdate(dt);
85 }

Перекрестные ссылки HasFSM() и m_FSM.

◆ ProcessEvent()

bool ProcessEvent ( HandEventBase e)
inlineprivate
26 {
27 if (HasFSM())
28 return m_FSM.ProcessEvent(e);
29 return false;
30 }

Перекрестные ссылки HasFSM() и m_FSM.

◆ SetParentState()

SetParentState ( HandStateBase parent)
inlineprivate

allows construction of hierarchical state machine

16{ m_parentState = parent; }

Перекрестные ссылки m_parentState.

◆ SyncAnimState()

void SyncAnimState ( )
inlineprivate
10{ }

Поля

◆ m_Action

WeaponActions m_Action
private

◆ m_ActionType

int m_ActionType
private

action to be played

◆ m_AnimState

int m_AnimState
private

◆ m_Dst

ref InventoryLocation m_Dst
private

◆ m_Dst1

ref InventoryLocation m_Dst1 = null
private

Используется в OnEntry().

◆ m_Dst2

ref InventoryLocation m_Dst2 = null
private

Используется в OnEntry().

◆ m_Entity

EntityAI m_Entity
private

◆ m_FSM

ref HandFSM m_FSM
private

hierarchical parent state of this state (or null)

Используется в AddTransition(), GetFSM(), HasFSM(), IsWaitingForActionFinish(), OnAbort(), OnEntry(), OnUpdate() и ProcessEvent().

◆ m_Hide [1/3]

ref HandStartHidingAnimated m_Hide
private

◆ m_Hide [2/3]

ref HandStartHidingAnimated m_Hide
private

weapon to be taken

◆ m_Hide [3/3]

ref HandTakingAnimated_Hide m_Hide
private

◆ m_ilEntity

ref InventoryLocation m_ilEntity
private

◆ m_parentState

HandStateBase m_parentState
private

entity that this state relates to

Используется в GetParentState(), HandStateBase() и SetParentState().

◆ m_Player

Man m_Player
private

Используется в HandStateBase() и OnStateChanged().

◆ m_Replacing [1/2]

◆ m_Replacing [2/2]

ref HandStartReplacingItemInHands m_Replacing
private

◆ m_Show [1/3]

◆ m_Show [2/3]

◆ m_Show [3/3]

ref HandTakingAnimated_Show m_Show
private

◆ m_Src1

ref InventoryLocation m_Src1 = null
private

Используется в OnEntry().

◆ m_Src2

ref InventoryLocation m_Src2 = null
private

Используется в OnEntry().

◆ m_Start

ref HandStartHidingAnimated m_Start
private

◆ m_Swap


Объявления и описания членов классов находятся в файлах: