DayZ 1.24
Loading...
Searching...
No Matches
ComponentsBank.c
Go to the documentation of this file.
2{
5
10
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 }
24
26 {
28 {
30 return true;
31 }
32
33 return false;
34 }
35
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 }
67
69 {
71 return true;
72
73 return false;
74 }
75}
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
Component GetComponent(int comp_type, string extended_class_name="")
bool IsComponentAlreadyExist(int comp_type)
ref Component m_Components[COMP_TYPE_COUNT]
void ComponentsBank(EntityAI entity_parent)
bool DeleteComponent(int comp_type)
EntityAI m_EntityParent
Component CreateComponent(int comp_type, string extended_class_name="")
const int COMP_TYPE_COUNT
Definition Component.c:12