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

◆ HandAnimatedForceSwapping_Inst()

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

◆ HandAnimatedMovingToAtt()

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

◆ 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
52{ 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
41 {
42 m_Dst = null;
43 super.OnAbort(e);
44 }
ref InventoryLocation m_Dst
Definition HandAnimatedForceSwapping.c:5

◆ OnAbort() [2/11]

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

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

◆ OnAbort() [3/11]

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

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

◆ OnAbort() [4/11]

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

Перекрестные ссылки 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 DEVELOPER
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:196
Definition Debug.c:735
static bool IsInventoryHFSMLogEnable()
Definition Debug.c:809

Перекрестные ссылки 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 {
19 player.OnItemInHandsChanged();
20 }
21 else
22 {
23 #ifdef DEVELOPER
25 {
26 Debug.InventoryHFSMLog("[hndfsm] HandAnimatedMoveToDst_W4T_Basic - not allowed");
27 }
28 #endif
29 }
30 }
31 else
32 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());
33 }
34 else
35 Error("[hndfsm] HandAnimatedMoveToDst_W4T_Basic - event has no valid m_Dst");
36
37 super.OnEntry(e);
38 }
Definition Building.c:6
script counterpart to engine's class Inventory
Definition Inventory.c:79
static proto native bool LocationCanMoveEntity(notnull InventoryLocation src, notnull InventoryLocation dst)
queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthan...
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:28

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

◆ OnEntry() [2/12]

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

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

◆ OnEntry() [3/12]

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

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

◆ OnEntry() [4/12]

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

Перекрестные ссылки 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:660

Перекрестные ссылки 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:749
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:754

Перекрестные ссылки 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:987
string WeaponActionTypeToString(int A, int AT)
Definition human.c:936

Перекрестные ссылки 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
47 {
48 m_Dst = null;
49 super.OnExit(e);
50 }

◆ OnExit() [2/12]

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

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

◆ OnExit() [3/12]

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

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

◆ OnExit() [4/12]

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

Перекрестные ссылки 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


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