Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
hand_states.c
Go to the documentation of this file.
1 
4 {
5  UNKNOWN = 0,
6  Empty = 1,
7  Equipped = 2,
8 }
9 
10 class HandStateEmpty : HandStableState
11 {
12  override void OnEntry(HandEventBase e)
13  {
14  if(e)
15  {
16  switch (e.m_EventID)
17  {
18  case HandEventID.MOVETO:
19  if (HumanInventory.HasInventoryReservation(e.GetSrcEntity(), e.GetDst()))
20  HumanInventory.ClearInventoryReservation(e.GetSrcEntity(), e.GetDst());
21  break;
22 
23  default: {};
24  }
25  }
26  super.OnEntry(e);
27  }
28  override void OnExit(HandEventBase e) { super.OnExit(e); }
29  override int GetCurrentStateID() { return HandStateID.Empty; }
30 };
31 
33 {
34  override void OnEntry(HandEventBase e)
35  {
36  if(e)
37  {
38  switch (e.m_EventID)
39  {
40  case HandEventID.MOVETO:
41  if (HumanInventory.HasInventoryReservation(e.GetSrcEntity(), e.GetDst()))
42  HumanInventory.ClearInventoryReservation(e.GetSrcEntity(), e.GetDst());
43  break;
44 
45  default: {};
46  }
47  }
48  super.OnEntry(e);
49  }
50  override void OnExit(HandEventBase e)
51  {
52  /*switch (e.m_EventID)
53  {
54  case HandEventID.MOVETO:
55  if (HumanInventory.HasInventoryReservation(e.GetSrcEntity(), e.GetDst()))
56  HumanInventory.ClearInventoryReservation(e.GetSrcEntity(), e.GetDst());
57  break;
58 
59  default: {};
60  }*/
61  super.OnExit(e);
62  }
63  override int GetCurrentStateID() { return HandStateID.Equipped; }
64 };
65 
67 
GetCurrentStateID
override int GetCurrentStateID()
Definition: hand_states.c:29
HandEventID
HandEventID
events
Definition: hand_events.c:6
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
HandStateEquipped
Definition: hand_states.c:32
Empty
Empty
Definition: hand_states.c:3
UNKNOWN
UNKNOWN
Definition: hand_states.c:2
HandStateID
HandStateID
states
Definition: hand_states.c:3
HumanInventory
inventory for plain man/human
Definition: humaninventory.c:9
Equipped
Equipped
Definition: hand_states.c:4
HandStableState
represents stable state (i.e. the basic states that the fsm will spend the most time in)
OnEntry
HandStateEquipped OnEntry
Definition: weaponchambering.c:208