DayZ 1.24
Loading...
Searching...
No Matches
BotTestSwapInternalC2H Class Reference
Inheritance diagram for BotTestSwapInternalC2H:
[legend]
Collaboration diagram for BotTestSwapInternalC2H:
[legend]

Private Member Functions

void BotTestSwapInternalC2H (Bot bot=NULL, BotStateBase parent=NULL)
 
override void OnEntry (BotEventBase e)
 
override void OnUpdate (float dt)
 
- Private Member Functions inherited from BotStateBase
void BotTimedWait (Bot bot=NULL, BotStateBase parent=NULL, float timeout=3.0)
 
override void OnEntry (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
void OnTimeout ()
 

Private Attributes

EntityAI m_Entity1
 
EntityAI m_Entity2
 
- Private Attributes inherited from BotStateBase
float m_Timeout = 3.0
 
bool m_Periodic = true
 

Detailed Description

Definition at line 43 of file Bot_Tests.c.

Constructor & Destructor Documentation

◆ BotTestSwapInternalC2H()

void BotTestSwapInternalC2H::BotTestSwapInternalC2H ( Bot bot = NULL,
BotStateBase parent = NULL )
inlineprivate

Definition at line 48 of file Bot_Tests.c.

49 { }

Member Function Documentation

◆ OnEntry()

override void BotTestSwapInternalC2H::OnEntry ( BotEventBase e)
inlineprivate

Definition at line 51 of file Bot_Tests.c.

52 {
53 super.OnEntry(e);
54 EntityAI j = m_Owner.GetInventory().CreateAttachment("Jeans_Blue");
55 m_Entity1 = j.GetInventory().CreateEntityInCargo("Rag");
56 EntityAI s = m_Owner.GetInventory().CreateInInventory("TacticalShirt_Grey");
57 m_Entity2 = s.GetInventory().CreateEntityInCargo("Roadflare");
58 m_Owner.PredictiveTakeEntityToHands(m_Entity2);
59 }
PlayerBase m_Owner
Definition BotStates.c:12

References m_Entity1, m_Entity2, and BotStateBase::m_Owner.

◆ OnUpdate()

override void BotTestSwapInternalC2H::OnUpdate ( float dt)
inlineprivate

Definition at line 61 of file Bot_Tests.c.

62 {
63 super.OnUpdate(dt);
64
65 if (m_Entity1 && m_Entity2)
66 {
67 if (m_Owner.GetInventory().CanSwapEntitiesEx(m_Entity1, m_Entity2))
68 {
69 botDebugPrint("[bot] + " + m_Owner + " -> swap item=" + m_Entity1 + " bot=" + m_Owner);
70 m_Owner.PredictiveSwapEntities(m_Entity1, m_Entity2);
71 }
72 else if (m_Owner.GetInventory().CanSwapEntitiesEx(m_Entity2, m_Entity1))
73 {
74 botDebugPrint("[bot] + " + m_Owner + " <- swap item=" + m_Entity2 + " bot=" + m_Owner);
75 m_Owner.PredictiveSwapEntities(m_Entity2, m_Entity1);
76 }
77 }
78 }
void botDebugPrint(string s)
Definition Bot.c:182

References botDebugPrint(), m_Entity1, m_Entity2, and BotStateBase::m_Owner.

Member Data Documentation

◆ m_Entity1

EntityAI BotTestSwapInternalC2H::m_Entity1
private

Definition at line 45 of file Bot_Tests.c.

Referenced by OnEntry(), and OnUpdate().

◆ m_Entity2

EntityAI BotTestSwapInternalC2H::m_Entity2
private

Definition at line 46 of file Bot_Tests.c.

Referenced by OnEntry(), and OnUpdate().


The documentation for this class was generated from the following file: