Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
handreplacingitemelsewherewithnewinhands.c
Go to the documentation of this file.
1 class HandStartReplacingItemElsewhereWithNewInHands extends HandStateBase
2 {
3  void HandStartReplacingItemElsewhereWithNewInHands (Man player = NULL, HandStateBase parent = NULL)
4  { }
5 
6  override void OnEntry (HandEventBase e)
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 
16  HumanInventoryWithFSM inv = HumanInventoryWithFSM.Cast(player.GetInventory());
17  edr.m_Lambda.Execute(inv);
18  return;
19  }
20  else
21  Error("[hndfsm] HandStartReplacingItemElsewhereWithNewInHands - not a HandEvenReplaceWithNewBase event");
22  }
23 
24  override void OnAbort (HandEventBase e)
25  {
26  super.OnAbort(e);
27  }
28 
29  override void OnExit (HandEventBase e)
30  {
31  super.OnExit(e);
32  }
33 
34  override bool IsWaitingForActionFinish () { return true; }
35 };
36 
37 
38 class HandReplacingItemElsewhereWithNewInHands extends HandStateBase
39 {
40  ref HandStartReplacingItemElsewhereWithNewInHands m_Replacing;
41 
42  void HandReplacingItemElsewhereWithNewInHands (Man player = NULL, HandStateBase parent = NULL)
43  {
44  // setup nested state machine
45  m_Replacing = new HandStartReplacingItemElsewhereWithNewInHands(player, this);
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  }
56 };
57 
58 
HandStateBase
represent hand state base
Definition: handanimatedforceswapping.c:3
HandTransition
FSMTransition< HandStateBase, HandEventBase, HandActionBase, HandGuardBase > HandTransition
Definition: handfsm.c:28
Error
void Error(string err)
Messagebox with error message.
Definition: endebug.c:90
OnAbort
override void OnAbort()
Definition: remotedetonator.c:300
LogManager
Definition: debug.c:734
OnExit
override void OnExit(HandEventBase e)
Definition: hand_states.c:28
HandEventBase
Abstracted event, not to be used, only inherited.
Definition: hand_events.c:194
HumanInventoryWithFSM
HumanInventory... with FSM (synchronous, no anims)
Definition: humaninventorywithfsm.c:5
IsWaitingForActionFinish
class WeaponChambering_Cartridge_InnerMag extends WeaponChambering_Base IsWaitingForActionFinish
Definition: weaponchambering.c:190
HandEventReplaceWithNewBase
Definition: hand_events.c:748
HandFSM
Hand finite state machine.
hndDebugPrint
void hndDebugPrint(string s)
Definition: handfsm.c:1
OnEntry
HandStateEquipped OnEntry
Definition: weaponchambering.c:208