Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
GadgetManagersSystem.c
Go to the documentation of this file.
1
class
GadgetManagersSystem
:
GameSystem
2
{
3
override
static
void
InitInfo(
WorldSystemInfo
outInfo)
4
{
5
outInfo
6
.SetAbstract(
false
)
7
.AddPoint(
ESystemPoint
.Frame);
8
}
9
10
protected
bool
m_bUpdating
=
false
;
11
protected
ref array<SCR_GadgetManagerComponent>
m_Components
= {};
12
protected
ref array<SCR_GadgetManagerComponent>
m_DeletedComponents
= {};
13
14
//------------------------------------------------------------------------------------------------
15
protected
override
void
OnUpdatePoint
(
WorldUpdatePointArgs
args)
16
{
17
float
timeSlice = args.GetTimeSliceSeconds();
18
19
m_bUpdating
=
true
;
20
21
foreach
(
SCR_GadgetManagerComponent
comp:
m_Components
)
22
{
23
comp.Update(timeSlice);
24
}
25
26
m_bUpdating
=
false
;
27
28
foreach
(
SCR_GadgetManagerComponent
comp:
m_DeletedComponents
)
29
{
30
Unregister
(comp);
31
}
32
m_DeletedComponents
.Clear();
33
}
34
35
//------------------------------------------------------------------------------------------------
36
protected
override
void
OnDiag
(
float
timeSlice)
37
{
38
DbgUI
.Begin(
"GadgetManagersSystem"
);
39
40
DbgUI
.Text(
"Managers: "
+
m_Components
.Count());
41
42
if
(
DbgUI
.Button(
"Dump active managers"
))
43
{
44
foreach
(
SCR_GadgetManagerComponent
comp:
m_Components
)
45
{
46
Print
(comp.GetOwner(),
LogLevel
.ERROR);
47
}
48
}
49
50
DbgUI
.End();
51
}
52
53
//------------------------------------------------------------------------------------------------
55
void
Register
(
SCR_GadgetManagerComponent
component)
56
{
57
//About to be deleted
58
if
(component.GetOwner().IsDeleted() || (component.GetOwner().GetFlags() &
EntityFlags
.USER5))
59
return
;
60
61
if
(
m_Components
.Find(component) != -1)
62
return
;
63
64
m_Components
.Insert(component);
65
}
66
67
//------------------------------------------------------------------------------------------------
68
void
Unregister
(
SCR_GadgetManagerComponent
component)
69
{
70
int
idx
=
m_Components
.Find(component);
71
if
(
idx
== -1)
72
return
;
73
74
if
(
m_bUpdating
)
75
m_DeletedComponents
.Insert(component);
76
else
77
m_Components
.Remove(
idx
);
78
}
79
}
idx
int idx
Definition
AIControlComponentSerializer.c:13
DbgUI
Definition
DbgUI.c:66
GadgetManagersSystem
Definition
GadgetManagersSystem.c:2
GadgetManagersSystem::OnDiag
override void OnDiag(float timeSlice)
Definition
GadgetManagersSystem.c:36
GadgetManagersSystem::Register
void Register(SCR_GadgetManagerComponent component)
Definition
GadgetManagersSystem.c:55
GadgetManagersSystem::m_Components
ref array< SCR_GadgetManagerComponent > m_Components
Definition
GadgetManagersSystem.c:11
GadgetManagersSystem::OnUpdatePoint
override void OnUpdatePoint(WorldUpdatePointArgs args)
Definition
GadgetManagersSystem.c:15
GadgetManagersSystem::m_bUpdating
bool m_bUpdating
Definition
GadgetManagersSystem.c:10
GadgetManagersSystem::m_DeletedComponents
ref array< SCR_GadgetManagerComponent > m_DeletedComponents
Definition
GadgetManagersSystem.c:12
GadgetManagersSystem::Unregister
void Unregister(SCR_GadgetManagerComponent component)
Definition
GadgetManagersSystem.c:68
GameSystem
Definition
GameSystem.c:16
SCR_GadgetManagerComponent
Definition
SCR_GadgetManagerComponent.c:140
WorldSystemInfo
Structure holding world system meta-information required by the engine.
Definition
WorldSystemInfo.c:14
WorldUpdatePointArgs
Structure holding extra data of WorldSystem update point.
Definition
WorldUpdatePointArgs.c:14
ESystemPoint
WorldSystemPoint ESystemPoint
Definition
gameLib.c:7
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
EntityFlags
EntityFlags
Various entity flags.
Definition
EntityFlags.c:14
scripts
Game
Systems
GadgetManagersSystem.c
Generated by
1.17.0