DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
BotGuards.c
См. документацию.
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
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
29class 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
43class 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
58class 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.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
76
77class BotGuardDebugEventMatches extends BotGuardBase
78{
80
82
84 {
86 if (!Class.CastTo(other, e))
87 {
88 return false;
89 }
90
91 return other.m_Id == m_Event.m_Id;
92 }
93};
void botDebugPrint(string s)
Определения Bot.c:122
DayZPlayer m_Player
Определения Hand_Events.c:42
void hndDebugPrint(string s)
Определения HandFSM.c:1
represents event that triggers transition from state to state
Определения BotEvents.c:5
int m_Id
Определения BotEvents.c:26
Определения BotEvents.c:25
override bool GuardCondition(BotEventBase e)
Определения BotGuards.c:21
ref BotGuardBase m_arg1
Определения BotGuards.c:17
void BotGuardOr(BotGuardBase arg0=NULL, BotGuardBase arg1=NULL)
Определения BotGuards.c:48
void BotGuardDebugEventMatches(BotEventStartDebug e=NULL)
Определения BotGuards.c:81
ref BotGuardBase m_arg0
Определения BotGuards.c:16
void BotGuardAnd(BotGuardBase arg0=NULL, BotGuardBase arg1=NULL)
Определения BotGuards.c:19
void BotGuardNot(BotGuardBase arg0=NULL)
Определения BotGuards.c:33
bool GuardCondition(BotEventBase e)
Определения BotGuards.c:11
ref BotEventStartDebug m_Event
Определения BotGuards.c:79
represents guard on a transition from state to state
Определения BotGuards.c:5
Super root of all classes in Enforce script.
Определения EnScript.c:11
Abstracted event, not to be used, only inherited.
Определения Hand_Events.c:209
void BotGuardHasItemInHands(Man p=NULL)
Определения BotGuards.c:61
Man m_Player
Определения Hand_Guards.c:83
override bool GuardCondition(HandEventBase e)
Определения BotGuards.c:63
TODO(kumarjac): This guard is unused but it has a fault and doesn't conform with maximimal/minimal ch...
Определения Hand_Guards.c:7
static bool IsInventoryHFSMLogEnable()
Определения Debug.c:668
Определения Debug.c:594
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.