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_PrefabsSpawnerManager.c
Go to the documentation of this file.
1
enum
EPrefabSpawnType
2
{
3
Generic
,
4
// AppleTrees,
5
CivilVehicles
,
6
MilitaryVehicles
,
7
MilitaryHeliVehicles
,
8
}
9
10
class
SCR_PrefabsSpawnerManagerClass : GenericEntityClass
11
{
12
}
13
15
class
SCR_PrefabsSpawnerManager
:
GenericEntity
16
{
17
[
Attribute
(
""
, UIWidgets.Object,
"Prefabs spawners, each for different type of SpawnPoints"
)]
18
protected
ref array<ref SCR_PrefabsSpawner> m_aPrefabsSpawners;
19
21
protected
static
ref map<EPrefabSpawnType, ref array<SCR_PrefabSpawnPoint>> s_aPrefabSpawnPoints =
new
map<EPrefabSpawnType, ref array<SCR_PrefabSpawnPoint>>();
22
23
//------------------------------------------------------------------------------------------------
26
static
void
RegisterPrefabSpawnPoint(
SCR_PrefabSpawnPoint
prefabSpawnPoint)
27
{
28
if
(
GetGame
().GetWorldEntity() && s_aPrefabSpawnPoints)
29
{
30
array<SCR_PrefabSpawnPoint> spawnPoints = s_aPrefabSpawnPoints[prefabSpawnPoint.GetType()];
31
32
if
(!spawnPoints)
33
{
34
spawnPoints = {};
35
s_aPrefabSpawnPoints.Insert(prefabSpawnPoint.GetType(), spawnPoints);
36
}
37
38
spawnPoints.Insert(prefabSpawnPoint);
39
}
40
}
41
42
//------------------------------------------------------------------------------------------------
45
static
void
UnregisterPrefabSpawnPoint(
SCR_PrefabSpawnPoint
prefabSpawnPoint)
46
{
47
if
(
GetGame
().GetWorldEntity() && s_aPrefabSpawnPoints)
48
{
49
array<SCR_PrefabSpawnPoint> spawnPoints = s_aPrefabSpawnPoints[prefabSpawnPoint.GetType()];
50
if
(spawnPoints)
51
spawnPoints.RemoveItem(prefabSpawnPoint);
52
}
53
}
54
55
//------------------------------------------------------------------------------------------------
59
override
void
EOnFrame
(
IEntity
owner,
float
timeSlice)
60
{
61
if
(!
GetGame
().GetWorldEntity() ||
RplSession
.Mode() ==
RplMode
.Client)
62
{
63
ClearEventMask
(
EntityEvent
.FRAME);
64
return
;
65
}
66
67
foreach
(
SCR_PrefabsSpawner
prefabsSpawner : m_aPrefabsSpawners)
68
{
69
prefabsSpawner.Spawn(s_aPrefabSpawnPoints[prefabsSpawner.GetType()]);
70
}
71
72
ClearEventMask
(
EntityEvent
.FRAME);
73
}
74
75
//------------------------------------------------------------------------------------------------
76
// constructor
79
void
SCR_PrefabsSpawnerManager
(
IEntitySource
src,
IEntity
parent)
80
{
81
SetEventMask
(
EntityEvent
.FRAME);
82
}
83
84
//------------------------------------------------------------------------------------------------
85
// destructor
86
void
~SCR_PrefabsSpawnerManager
()
87
{
88
s_aPrefabSpawnPoints =
new
map<EPrefabSpawnType, ref array<SCR_PrefabSpawnPoint>
>();
89
}
90
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
RplMode
RplMode
Mode of replication.
Definition
RplMode.c:9
SCR_PrefabSpawnPoint
void SCR_PrefabSpawnPoint(IEntitySource src, IEntity parent)
Definition
SCR_PrefabSpawnPoint.c:40
Generic
Generic
Definition
SCR_PrefabsSpawnerManager.c:0
CivilVehicles
CivilVehicles
Definition
SCR_PrefabsSpawnerManager.c:2
MilitaryHeliVehicles
MilitaryHeliVehicles
Definition
SCR_PrefabsSpawnerManager.c:4
~SCR_PrefabsSpawnerManager
void ~SCR_PrefabsSpawnerManager()
Definition
SCR_PrefabsSpawnerManager.c:86
EPrefabSpawnType
EPrefabSpawnType
Definition
SCR_PrefabsSpawnerManager.c:2
SCR_PrefabsSpawnerManager
void SCR_PrefabsSpawnerManager(IEntitySource src, IEntity parent)
Definition
SCR_PrefabsSpawnerManager.c:79
MilitaryVehicles
MilitaryVehicles
Definition
SCR_PrefabsSpawnerManager.c:3
GenericEntity
Definition
GenericEntity.c:16
IEntity
Definition
IEntity.c:13
IEntity::SetEventMask
proto external EntityEvent SetEventMask(EntityEvent e)
IEntity::EOnFrame
void EOnFrame(IEntity owner, float timeSlice)
IEntity::ClearEventMask
proto external EntityEvent ClearEventMask(EntityEvent e)
IEntitySource
Definition
IEntitySource.c:13
RplSession
Definition
RplSession.c:8
SCR_PrefabsSpawner
Base class for Prefabs Spawning.
Definition
SCR_PrefabsSpawner.c:4
map
Definition
Types.c:486
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EntityEvent
EntityEvent
Various entity events.
Definition
EntityEvent.c:14
scripts
Game
GameMode
PrefabsSpawning
SCR_PrefabsSpawnerManager.c
Generated by
1.17.0