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

Private Member Functions

void ComponentsBank (EntityAI entity_parent)
 
Component GetComponent (int comp_type, string extended_class_name="")
 
bool DeleteComponent (int comp_type)
 
Component CreateComponent (int comp_type, string extended_class_name="")
 
bool IsComponentAlreadyExist (int comp_type)
 

Private Attributes

EntityAI m_EntityParent
 
ref Component m_Components [COMP_TYPE_COUNT]
 

Detailed Description

Definition at line 1 of file ComponentsBank.c.

Constructor & Destructor Documentation

◆ ComponentsBank()

void ComponentsBank::ComponentsBank ( EntityAI entity_parent)
inlineprivate

Definition at line 6 of file ComponentsBank.c.

7 {
9 }
EntityAI m_EntityParent

References m_EntityParent.

Member Function Documentation

◆ CreateComponent()

Component ComponentsBank::CreateComponent ( int comp_type,
string extended_class_name = "" )
inlineprivate

Definition at line 36 of file ComponentsBank.c.

37 {
39 {
40 Component.LogErrorBadCompType(comp_type, "EntityAI->CreateComponent(int comp_type)");
41 return NULL;
42 }
43
45 {
46 Component.LogWarningAlredyExist(comp_type, "EntityAI->CreateComponent(int comp_type)");
47 return m_Components[comp_type];
48 }
49
50
52
53 if (clas_name == string.Empty)
55
56 Component comp = Component.Cast(clas_name.ToType().Spawn());
57
58 comp.SetParentEntityAI(m_EntityParent);
59 comp.Event_OnAwake();
60
62
63 comp.Event_OnInit();
64
65 return comp;
66 }
Empty
Definition Hand_States.c:14
static void LogErrorBadCompType(int comp_type, string fnc_name)
Definition Component.c:74
static void LogWarningAlredyExist(int comp_type, string fnc_name)
Definition Component.c:83
static string GetNameByType(int comp_type)
Definition Component.c:48
static bool IsTypeExist(int comp_type)
Definition Component.c:62
bool IsComponentAlreadyExist(int comp_type)
ref Component m_Components[COMP_TYPE_COUNT]

References Empty, Component::GetNameByType(), IsComponentAlreadyExist(), Component::IsTypeExist(), Component::LogErrorBadCompType(), Component::LogWarningAlredyExist(), m_Components, and m_EntityParent.

Referenced by GetComponent().

◆ DeleteComponent()

bool ComponentsBank::DeleteComponent ( int comp_type)
inlineprivate

Definition at line 25 of file ComponentsBank.c.

26 {
28 {
30 return true;
31 }
32
33 return false;
34 }

References IsComponentAlreadyExist(), and m_Components.

◆ GetComponent()

Component ComponentsBank::GetComponent ( int comp_type,
string extended_class_name = "" )
inlineprivate

Definition at line 11 of file ComponentsBank.c.

12 {
14 {
15 Component.LogErrorBadCompType(comp_type, "EntityAI.GetComponent(int comp_type)");
16 return NULL;
17 }
18
21
22 return m_Components[comp_type];
23 }
Component CreateComponent(int comp_type, string extended_class_name="")

References CreateComponent(), IsComponentAlreadyExist(), Component::IsTypeExist(), Component::LogErrorBadCompType(), and m_Components.

◆ IsComponentAlreadyExist()

bool ComponentsBank::IsComponentAlreadyExist ( int comp_type)
inlineprivate

Definition at line 68 of file ComponentsBank.c.

69 {
71 return true;
72
73 return false;
74 }

References m_Components.

Referenced by CreateComponent(), DeleteComponent(), and GetComponent().

Member Data Documentation

◆ m_Components

ref Component ComponentsBank::m_Components[COMP_TYPE_COUNT]
private

◆ m_EntityParent

EntityAI ComponentsBank::m_EntityParent
private

Definition at line 3 of file ComponentsBank.c.

Referenced by ComponentsBank(), and CreateComponent().


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