DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
HandStateBase.c
См. документацию.
1
7{
8 Man m_Player;
11 void HandStateBase (Man player = NULL, HandStateBase parent = NULL) { m_Player = player; m_parentState = parent; }
12
16 void SetParentState (HandStateBase parent) { m_parentState = parent; }
21
22 bool HasFSM () { return m_FSM != NULL; }
23 HandFSM GetFSM () { return m_FSM; }
24
26 {
27 if (HasFSM())
28 return m_FSM.ProcessEvent(e);
29 return false;
30 }
31
36 {
37 if (HasFSM())
38 m_FSM.AddTransition(t);
39 else
40 Error("[hndfsm] adding transition to state without FSM. Configure FSM first.");
41 }
42
43
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 }
75
81 void OnUpdate (float dt)
82 {
83 if (HasFSM() && m_FSM.IsRunning())
84 m_FSM.GetCurrentState().OnUpdate(dt);
85 }
86
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 }
101
107 {
108 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[hndfsm] } " + Object.GetDebugName(e.m_Player) + " STS = " + e.m_Player.GetSimulationTimeStamp() + " " + this.Type().ToString());
109 }
110
115 bool IsWaitingForActionFinish () { return HasFSM() && m_FSM.IsRunning() && m_FSM.GetCurrentState().IsWaitingForActionFinish(); }
116
121 bool IsIdle () { return false; }
122
129
136 {
137 m_Player.GetHumanInventory().OnHandsStateChanged(src, dst);
138 }
139};
140
141
142
proto string ToString()
void hndDebugPrint(string s)
Определения HandFSM.c:1
FSMTransition< HandStateBase, HandEventBase, HandActionBase, HandGuardBase > HandTransition
Определения HandFSM.c:28
string Type
Определения JsonDataContaminatedArea.c:11
Abstracted event, not to be used, only inherited.
Определения Hand_Events.c:209
Hand finite state machine.
void OnSubMachineChanged(HandStateBase src, HandStateBase dst)
called when sub-machine has changed its state
Определения HandStateBase.c:128
HandStateBase GetParentState()
Определения HandStateBase.c:20
void AddTransition(HandTransition t)
adds transition into m_FSM transition table
Определения HandStateBase.c:35
void HandStateBase(Man player=NULL, HandStateBase parent=NULL)
nested state machine (or null)
Определения HandStateBase.c:11
bool ProcessEvent(HandEventBase e)
Определения HandStateBase.c:25
void OnUpdate(float dt)
Определения HandStateBase.c:81
bool IsWaitingForActionFinish()
Определения HandStateBase.c:115
void SetParentState(HandStateBase parent)
allows construction of hierarchical state machine
Определения HandStateBase.c:16
bool HasFSM()
Определения HandStateBase.c:22
Man m_Player
Определения HandStateBase.c:8
void OnStateChanged(HandStateBase src, HandStateBase dst)
called on current state when state machine has changed its state
Определения HandStateBase.c:135
void OnExit(HandEventBase e)
Определения HandStateBase.c:106
ref HandFSM m_FSM
hierarchical parent state of this state (or null)
Определения HandStateBase.c:10
HandStateBase m_parentState
entity that this state relates to
Определения HandStateBase.c:9
HandFSM GetFSM()
Определения HandStateBase.c:23
bool IsIdle()
Определения HandStateBase.c:121
void OnEntry(HandEventBase e)
Определения HandStateBase.c:49
void OnAbort(HandEventBase e)
Определения HandStateBase.c:91
represent hand state base
Определения HandAnimatedForceSwapping.c:4
static bool IsInventoryHFSMLogEnable()
Определения Debug.c:668
Определения Debug.c:594
Определения ObjectTyped.c:2
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90