Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
handfsm.c
Go to the documentation of this file.
1
void
hndDebugPrint
(
string
s)
2
{
3
#ifdef INV_DEBUG
4
PrintToRPT
(
""
+ s);
// comment/uncomment to hide/see debug logs
5
#else
6
//Print("" + s); // comment/uncomment to hide/see debug logs
7
#endif
8
}
9
void
hndDebugSpam
(
string
s)
10
{
11
#ifdef INV_DEBUG_SPAM
12
PrintToRPT
(
""
+ s);
// comment/uncomment to hide/see debug logs
13
#else
14
//Print("" + s); // comment/uncomment to hide/see debug logs
15
#endif
16
}
17
void
hndDebugSpamALot
(
string
s)
18
{
19
#ifdef INV_DEBUG_SPAM_FREQ
20
PrintToRPT
(
""
+ s);
// comment/uncomment to hide/see debug logs
21
#else
22
//Print("" + s); // comment/uncomment to hide/see debug logs
23
#endif
24
}
25
26
27
28
typedef
FSMTransition<HandStateBase, HandEventBase, HandActionBase, HandGuardBase>
HandTransition
;
29
30
34
class
HandFSM
extends
HFSMBase
<HandStateBase, HandEventBase, HandActionBase, HandGuardBase>
35
{
36
int
GetCurrentStateID
()
37
{
38
HandStableState
hState =
HandStableState
.Cast(
m_State
);
39
if
(hState)
40
return
hState.GetCurrentStateID();
41
42
return
HandStateID
.UNKNOWN;
43
}
44
49
protected
bool
SyncStateFromID
(
int
id
)
50
{
51
/*if (id == 0)
52
return false;
53
54
int s0 = id & 0x000000ff;
55
int s1 = id & 0x0000ff00;
56
57
int count = m_Transitions.Count();
58
bool set0 = false;
59
bool set1 = false;
60
for (int i = 0; i < count; ++i)
61
{
62
HandTransition t = m_Transitions.Get(i);
63
if (!set0 && t.m_srcState && s0 == t.m_srcState.GetCurrentStateID())
64
{
65
m_States[0] = t.m_srcState;
66
set0 = true;
67
}
68
if (!set1 && t.m_srcState && s1 == t.m_srcState.GetCurrentStateID())
69
{
70
m_States[1] = t.m_srcState;
71
set1 = true;
72
}
73
if (set0 && set1)
74
return true;
75
}*/
76
return
false
;
77
}
78
82
bool
OnStoreLoad
(
ParamsReadContext
ctx,
int
version)
83
{
84
/*int id = 0;
85
ctx.Read(id);
86
if (SyncStateFromID(id))
87
if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[hndfsm] OnStoreLoad - loaded current state from id=" + id);
88
else
89
Print("[hndfsm] Warning! OnStoreLoad - cannot load curent hand state, id=" + id);*/
90
return
true
;
91
}
92
96
void
OnStoreSave
(
ParamsWriteContext
ctx)
97
{
98
/*int id = GetCurrentStateID();
99
ctx.Write(id);
100
if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[hndfsm] OnStoreSave - saving current state=" + GetCurrentState() + " id=" + id);*/
101
}
102
106
void
NetSyncCurrentStateID
(
int
id
)
107
{
108
/*if (SyncStateFromID(id))
109
if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[hndfsm] NetSyncCurrentStateID - loaded current state from id=" + id);
110
else
111
Print("[hndfsm] NetSyncCurrentStateID called with null, ignoring request to set current fsm state.");*/
112
}
113
};
114
FSMTransition
represents transition src -— event[guard]/action -—|> dst
HFSMBase< HandStateBase, HandEventBase, HandActionBase, HandGuardBase >::GetCurrentStateID
int GetCurrentStateID()
Definition
handfsm.c:36
HFSMBase< HandStateBase, HandEventBase, HandActionBase, HandGuardBase >::SyncStateFromID
bool SyncStateFromID(int id)
Definition
handfsm.c:49
HFSMBase< HandStateBase, HandEventBase, HandActionBase, HandGuardBase >::OnStoreLoad
bool OnStoreLoad(ParamsReadContext ctx, int version)
Definition
handfsm.c:82
HFSMBase< HandStateBase, HandEventBase, HandActionBase, HandGuardBase >::OnStoreSave
void OnStoreSave(ParamsWriteContext ctx)
Definition
handfsm.c:96
HFSMBase< HandStateBase, HandEventBase, HandActionBase, HandGuardBase >::NetSyncCurrentStateID
void NetSyncCurrentStateID(int id)
Definition
handfsm.c:106
HFSMBase
base class for hierarchic finite state machine
HandFSM
Hand finite state machine.
HandStableState
represents stable state (i.e.
ParamsReadContext
Serializer ParamsReadContext
Definition
gameplay.c:15
ParamsWriteContext
Serializer ParamsWriteContext
Definition
gameplay.c:16
PrintToRPT
proto void PrintToRPT(void var)
Prints content of variable to RPT file (performance warning - each write means fflush!...
HandStateID
HandStateID
states
Definition
hand_states.c:4
hndDebugSpam
void hndDebugSpam(string s)
Definition
handfsm.c:9
hndDebugSpamALot
void hndDebugSpamALot(string s)
Definition
handfsm.c:17
hndDebugPrint
void hndDebugPrint(string s)
Definition
handfsm.c:1
HandTransition
FSMTransition< HandStateBase, HandEventBase, HandActionBase, HandGuardBase > HandTransition
Definition
handfsm.c:28
m_State
enum EObjectTemperatureState m_State
Games
Dayz
scripts
3_game
systems
inventory
handfsm.c
Generated by
1.17.0