Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
botguards.c
Go to the documentation of this file.
1
4
class
BotGuardBase
5
{
11
bool
GuardCondition
(
BotEventBase
e) {
return
true
; }
12
};
13
14
class
BotGuardAnd
extends
BotGuardBase
15
{
16
ref
BotGuardBase
m_arg0
;
17
ref
BotGuardBase
m_arg1
;
18
19
void
BotGuardAnd
(
BotGuardBase
arg0 = NULL,
BotGuardBase
arg1 = NULL) {
m_arg0
= arg0;
m_arg1
= arg1; }
20
21
override
bool
GuardCondition
(
BotEventBase
e)
22
{
23
bool
result =
m_arg0
.GuardCondition(e) &&
m_arg1
.GuardCondition(e);
24
botDebugPrint
(
"[botfsm] guard - "
+
m_arg0
.Type() +
" && "
+
m_arg1
.Type() +
" = "
+ result);
25
return
result;
26
}
27
};
28
29
class
BotGuardNot
extends
BotGuardBase
30
{
31
ref BotGuardBase m_arg0;
32
33
void
BotGuardNot
(
BotGuardBase
arg0 = NULL) {
m_arg0
= arg0; }
34
35
override
bool
GuardCondition
(
BotEventBase
e)
36
{
37
bool
result = !
m_arg0
.GuardCondition(e);
38
botDebugPrint
(
"[botfsm] guard - ! "
+
m_arg0
.Type() +
" = "
+ result);
39
return
result;
40
}
41
};
42
43
class
BotGuardOr
extends
BotGuardBase
44
{
45
ref BotGuardBase m_arg0;
46
ref BotGuardBase m_arg1;
47
48
void
BotGuardOr
(
BotGuardBase
arg0 = NULL,
BotGuardBase
arg1 = NULL) {
m_arg0
= arg0;
m_arg1
= arg1; }
49
50
override
bool
GuardCondition
(
BotEventBase
e)
51
{
52
bool
result =
m_arg0
.GuardCondition(e) ||
m_arg1
.GuardCondition(e);
53
botDebugPrint
(
"[botfsm] guard - "
+
m_arg0
.Type() +
" || "
+
m_arg1
.Type() +
" = "
+ result);
54
return
result;
55
}
56
};
57
58
class
BotGuardHasItemInHands
extends
HandGuardBase
59
{
60
protected
Man
m_Player
;
61
void
BotGuardHasItemInHands
(Man p = NULL) {
m_Player
= p; }
62
63
override
bool
GuardCondition
(
HandEventBase
e)
64
{
65
if
(
m_Player
.GetEntityInHands())
66
{
67
if
(
LogManager
.
IsInventoryHFSMLogEnable
())
hndDebugPrint
(
"[botfsm] guard - has valid entity in hands"
);
68
return
true
;
69
}
70
71
if
(
LogManager
.
IsInventoryHFSMLogEnable
())
hndDebugPrint
(
"[botfsm] guard - no entity in hands"
);
72
return
false
;
73
}
74
};
75
76
77
class
BotGuardDebugEventMatches
extends
BotGuardBase
78
{
79
protected
ref
BotEventStartDebug
m_Event
;
80
81
void
BotGuardDebugEventMatches
(
BotEventStartDebug
e = NULL) {
m_Event
= e; }
82
83
override
bool
GuardCondition
(
BotEventBase
e)
84
{
85
BotEventStartDebug
other;
86
if
(!
Class
.
CastTo
(other, e))
87
{
88
return
false
;
89
}
90
91
return
other.
m_Id
==
m_Event
.m_Id;
92
}
93
};
botDebugPrint
void botDebugPrint(string s)
Definition
bot.c:122
m_Player
map m_Player
BotEventBase
represents event that triggers transition from state to state
Definition
botevents.c:5
BotEventStartDebug
Definition
botevents.c:25
BotEventStartDebug::m_Id
int m_Id
Definition
botevents.c:26
BotGuardBase
represents guard on a transition from state to state
Definition
botguards.c:5
BotGuardBase::BotGuardAnd
void BotGuardAnd(BotGuardBase arg0=NULL, BotGuardBase arg1=NULL)
Definition
botguards.c:19
BotGuardBase::GuardCondition
bool GuardCondition(BotEventBase e)
Definition
botguards.c:11
BotGuardBase::GuardCondition
override bool GuardCondition(BotEventBase e)
Definition
botguards.c:21
BotGuardBase::BotGuardOr
void BotGuardOr(BotGuardBase arg0=NULL, BotGuardBase arg1=NULL)
Definition
botguards.c:48
BotGuardBase::m_arg1
ref BotGuardBase m_arg1
Definition
botguards.c:17
BotGuardBase::m_arg0
ref BotGuardBase m_arg0
Definition
botguards.c:16
BotGuardBase::BotGuardNot
void BotGuardNot(BotGuardBase arg0=NULL)
Definition
botguards.c:33
BotGuardBase::m_Event
ref BotEventStartDebug m_Event
Definition
botguards.c:79
BotGuardBase::BotGuardDebugEventMatches
void BotGuardDebugEventMatches(BotEventStartDebug e=NULL)
Definition
botguards.c:81
Class
Super root of all classes in Enforce script.
Definition
enscript.c:11
HandEventBase
Abstracted event, not to be used, only inherited.
Definition
hand_events.c:212
HandGuardBase
TODO(kumarjac): This guard is unused but it has a fault and doesn't conform with maximimal/minimal ch...
Definition
hand_guards.c:7
HandGuardBase::GuardCondition
override bool GuardCondition(HandEventBase e)
Definition
botguards.c:63
HandGuardBase::BotGuardHasItemInHands
void BotGuardHasItemInHands(Man p=NULL)
Definition
botguards.c:61
HandGuardBase::m_Player
Man m_Player
Definition
hand_guards.c:83
LogManager
Definition
debug.c:692
LogManager::IsInventoryHFSMLogEnable
static bool IsInventoryHFSMLogEnable()
Definition
debug.c:766
Class::CastTo
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
hndDebugPrint
void hndDebugPrint(string s)
Definition
handfsm.c:1
Games
Dayz
scripts
4_world
systems
bot
botguards.c
Generated by
1.17.0