Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
FuelConsumptionSystem.c
Go to the documentation of this file.
1
class
FuelConsumptionSystem
:
GameSystem
2
{
3
override
static
void
InitInfo(
WorldSystemInfo
outInfo)
4
{
5
outInfo
6
.SetAbstract(
false
)
7
.AddPoint(
ESystemPoint
.FixedFrame);
8
}
9
10
protected
ref array<SCR_FuelConsumptionComponent>
m_Components
= {};
11
12
//------------------------------------------------------------------------------------------------
13
override
bool
ShouldBePaused
()
14
{
15
return
true
;
16
}
17
18
//------------------------------------------------------------------------------------------------
19
protected
override
void
OnUpdatePoint
(
WorldUpdatePointArgs
args)
20
{
21
float
timeSlice = args.GetTimeSliceSeconds();
22
23
foreach
(SCR_FuelConsumptionComponent comp:
m_Components
)
24
{
25
comp.Update(timeSlice);
26
}
27
}
28
29
//------------------------------------------------------------------------------------------------
30
protected
override
void
OnDiag
(
float
timeSlice)
31
{
32
DbgUI
.Begin(
"FuelConsumptionSystem"
);
33
34
DbgUI
.Text(
"Items: "
+
m_Components
.Count());
35
36
if
(
DbgUI
.Button(
"Dump active components"
))
37
{
38
foreach
(SCR_FuelConsumptionComponent comp:
m_Components
)
39
{
40
Print
(comp.GetOwner(),
LogLevel
.ERROR);
41
}
42
}
43
44
DbgUI
.End();
45
}
46
47
//------------------------------------------------------------------------------------------------
49
void
Register
(SCR_FuelConsumptionComponent component)
50
{
51
//About to be deleted
52
if
(component.GetOwner().IsDeleted() || (component.GetOwner().GetFlags() &
EntityFlags
.USER5))
53
return
;
54
55
if
(
m_Components
.Find(component) != -1)
56
return
;
57
58
m_Components
.Insert(component);
59
}
60
61
//------------------------------------------------------------------------------------------------
62
void
Unregister
(SCR_FuelConsumptionComponent component)
63
{
64
int
idx
=
m_Components
.Find(component);
65
if
(
idx
== -1)
66
return
;
67
68
m_Components
.Remove(
idx
);
69
}
70
}
idx
int idx
Definition
AIControlComponentSerializer.c:13
DbgUI
Definition
DbgUI.c:66
FuelConsumptionSystem
Definition
FuelConsumptionSystem.c:2
FuelConsumptionSystem::Unregister
void Unregister(SCR_FuelConsumptionComponent component)
Definition
FuelConsumptionSystem.c:62
FuelConsumptionSystem::OnDiag
override void OnDiag(float timeSlice)
Definition
FuelConsumptionSystem.c:30
FuelConsumptionSystem::m_Components
ref array< SCR_FuelConsumptionComponent > m_Components
Definition
FuelConsumptionSystem.c:10
FuelConsumptionSystem::ShouldBePaused
override bool ShouldBePaused()
Definition
FuelConsumptionSystem.c:13
FuelConsumptionSystem::OnUpdatePoint
override void OnUpdatePoint(WorldUpdatePointArgs args)
Definition
FuelConsumptionSystem.c:19
FuelConsumptionSystem::Register
void Register(SCR_FuelConsumptionComponent component)
Definition
FuelConsumptionSystem.c:49
GameSystem
Definition
GameSystem.c:16
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
FuelConsumptionSystem.c
Generated by
1.17.0