Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_GameCoresManager.c
Go to the documentation of this file.
1
3
7
[
BaseContainerProps
(configRoot:
true
)]
8
class
SCR_GameCoresManager
9
{
10
protected
static
const
ResourceName
CORE_CONFIG_PATH
=
"{A9ACCDC72AD70995}Configs/Core/Cores.conf"
;
11
12
[
Attribute
()]
13
protected
ref array<ref SCR_GameCoreBase>
m_aCores
;
14
15
protected
ref array<SCR_GameCoreBase>
m_CoresSorted
=
new
array<SCR_GameCoreBase>;
16
protected
static
ref
map<typename, SCR_GameCoreBase>
m_CoresMap
=
new
map<typename, SCR_GameCoreBase>
;
17
18
void
OnAfterInit
()
19
{
20
foreach
(SCR_GameCoreBase core:
m_CoresSorted
)
21
{
22
if
(core)
23
core.OnAfterInit();
24
}
25
}
26
void
OnGameStart
()
27
{
28
foreach
(SCR_GameCoreBase core:
m_CoresSorted
)
29
{
30
if
(core)
31
core.OnGameStart();
32
}
33
}
34
void
OnWorldPostProcess
(
World
world)
35
{
36
foreach
(SCR_GameCoreBase core:
m_CoresSorted
)
37
{
38
if
(core)
39
core.OnWorldPostProcess(world);
40
}
41
}
42
void
OnUpdate
(
float
timeSlice)
43
{
44
foreach
(SCR_GameCoreBase core:
m_CoresSorted
)
45
{
46
if
(core)
47
core.OnUpdate(timeSlice);
48
}
49
}
50
void
OnGameEnd
()
51
{
52
foreach
(SCR_GameCoreBase core:
m_CoresSorted
)
53
{
54
if
(core)
55
core.OnGameEnd();
56
}
57
}
58
void
OnBeforeWorldCleanup
()
59
{
60
foreach
(SCR_GameCoreBase core:
m_CoresSorted
)
61
{
62
if
(core)
63
core.OnBeforeWorldCleanup();
64
}
65
}
66
72
static
SCR_GameCoreBase
GetCore
(
typename
type
)
73
{
74
return
m_CoresMap
.Get(
type
);
75
}
76
80
static
SCR_GameCoresManager
CreateCoresManager
()
81
{
82
Resource
container =
BaseContainerTools
.LoadContainer(
CORE_CONFIG_PATH
);
83
if
(!container || !container.IsValid())
84
{
85
Print
(
string
.Format(
"Core config '%1' not found!"
,
CORE_CONFIG_PATH
),
LogLevel
.ERROR);
86
return
null;
87
}
88
89
Managed instance =
BaseContainerTools
.CreateInstanceFromContainer(container.GetResource().ToBaseContainer());
90
SCR_GameCoresManager
manager =
SCR_GameCoresManager
.Cast(instance);
91
if
(!manager)
92
{
93
Print
(
string
.Format(
"SCR_GameCoresManager class not found in '%1'!"
,
CORE_CONFIG_PATH
),
LogLevel
.ERROR);
94
delete
instance;
95
return
null;
96
}
97
98
return
manager;
99
}
100
void
SCR_GameCoresManager
()
101
{
102
m_CoresMap
=
new
map<typename, SCR_GameCoreBase>
;
103
foreach
(SCR_GameCoreBase core:
m_aCores
)
104
{
105
if
(!core.IsEnabled() || !core.CanCreate())
106
continue
;
107
108
if
(!
m_CoresMap
.Contains(core.Type()))
109
{
110
//--- Add by priority
111
int
priority = core.GetPriority();
112
int
index
= 0;
113
for
(
int
c = 0, count =
m_CoresSorted
.Count(); c < count; c++)
114
{
115
index
= c;
116
if
(priority >
m_CoresSorted
[c].
GetPriority
())
117
break
;
118
}
119
m_CoresSorted
.InsertAt(core,
index
);
120
m_CoresMap
.Insert(core.Type(), core);
121
}
122
else
123
{
124
Print
(
string
.Format(
"Duplicate definition of core '%1'!"
, core.Type()),
LogLevel
.ERROR);
125
}
126
}
127
128
OnAfterInit
();
129
}
130
};
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
type
EDamageType type
Definition
SCR_DestructibleTreeV2.c:32
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
BaseContainerTools
Definition
BaseContainerTools.c:13
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
SCR_GameCoresManager::OnGameEnd
void OnGameEnd()
Definition
SCR_GameCoresManager.c:50
SCR_GameCoresManager::OnGameStart
void OnGameStart()
Definition
SCR_GameCoresManager.c:26
SCR_GameCoresManager::m_aCores
ref array< ref SCR_GameCoreBase > m_aCores
Definition
SCR_GameCoresManager.c:13
SCR_GameCoresManager::OnUpdate
void OnUpdate(float timeSlice)
Definition
SCR_GameCoresManager.c:42
SCR_GameCoresManager::CORE_CONFIG_PATH
static const ResourceName CORE_CONFIG_PATH
Definition
SCR_GameCoresManager.c:10
SCR_GameCoresManager::OnBeforeWorldCleanup
void OnBeforeWorldCleanup()
Definition
SCR_GameCoresManager.c:58
SCR_GameCoresManager::GetCore
static SCR_GameCoreBase GetCore(typename type)
Definition
SCR_GameCoresManager.c:72
SCR_GameCoresManager::OnWorldPostProcess
void OnWorldPostProcess(World world)
Definition
SCR_GameCoresManager.c:34
SCR_GameCoresManager::CreateCoresManager
static SCR_GameCoresManager CreateCoresManager()
Definition
SCR_GameCoresManager.c:80
SCR_GameCoresManager::m_CoresSorted
ref array< SCR_GameCoreBase > m_CoresSorted
Definition
SCR_GameCoresManager.c:15
SCR_GameCoresManager::OnAfterInit
void OnAfterInit()
Definition
SCR_GameCoresManager.c:18
SCR_GameCoresManager::m_CoresMap
static ref map< typename, SCR_GameCoreBase > m_CoresMap
Definition
SCR_GameCoresManager.c:16
SCR_GameCoresManager::SCR_GameCoresManager
void SCR_GameCoresManager()
Definition
SCR_GameCoresManager.c:100
World
Definition
World.c:16
map
Definition
Types.c:486
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
GetPriority
int GetPriority()
Definition
SCR_BaseManualCameraComponent.c:247
scripts
Game
GameCore
SCR_GameCoresManager.c
Generated by
1.17.0