DayZ 1.24
Loading...
Searching...
No Matches
BotGuards.c
Go to the documentation of this file.
1
5{
11 bool GuardCondition(BotEventBase e) { return true; }
12};
13
14class BotGuardAnd extends BotGuardBase
15{
18
19 void BotGuardAnd(BotGuardBase arg0 = NULL, BotGuardBase arg1 = NULL) { m_arg0 = arg0; m_arg1 = arg1; }
20
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
29class BotGuardNot extends BotGuardBase
30{
32
33 void BotGuardNot(BotGuardBase arg0 = NULL) { m_arg0 = arg0; }
34
36 {
37 bool result = !m_arg0.GuardCondition(e);
38 botDebugPrint("[botfsm] guard - ! " + m_arg0.Type() + " = " + result);
39 return result;
40 }
41};
42
43class BotGuardOr extends BotGuardBase
44{
47
48 void BotGuardOr(BotGuardBase arg0 = NULL, BotGuardBase arg1 = NULL) { m_arg0 = arg0; m_arg1 = arg1; }
49
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
58class BotGuardHasItemInHands extends HandGuardBase
59{
60 protected Man m_Player;
62
64 {
65 if (m_Player.GetHumanInventory().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
void botDebugPrint(string s)
Definition Bot.c:182
DayZPlayer m_Player
Definition Hand_Events.c:42
void hndDebugPrint(string s)
Definition HandFSM.c:1
represents event that triggers transition from state to state
Definition BotEvents.c:5
represents guard on a transition from state to state
Definition BotGuards.c:5
override bool GuardCondition(BotEventBase e)
Definition BotGuards.c:21
ref BotGuardBase m_arg1
Definition BotGuards.c:17
void BotGuardOr(BotGuardBase arg0=NULL, BotGuardBase arg1=NULL)
Definition BotGuards.c:48
ref BotGuardBase m_arg0
Definition BotGuards.c:16
void BotGuardAnd(BotGuardBase arg0=NULL, BotGuardBase arg1=NULL)
Definition BotGuards.c:19
void BotGuardNot(BotGuardBase arg0=NULL)
Definition BotGuards.c:33
bool GuardCondition(BotEventBase e)
Definition BotGuards.c:11
Abstracted event, not to be used, only inherited.
TODO(kumarjac): This guard is unused but it has a fault and doesn't conform with maximimal/minimal ch...
Definition Hand_Guards.c:7
void BotGuardHasItemInHands(Man p=NULL)
Definition BotGuards.c:61
override bool GuardCondition(HandEventBase e)
Definition BotGuards.c:63
static bool IsInventoryHFSMLogEnable()
Definition Debug.c:749