Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PrefabsSpawnerManager.c
Go to the documentation of this file.
9
10class SCR_PrefabsSpawnerManagerClass : GenericEntityClass
11{
12}
13
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 {
64 return;
65 }
66
67 foreach (SCR_PrefabsSpawner prefabsSpawner : m_aPrefabsSpawners)
68 {
69 prefabsSpawner.Spawn(s_aPrefabSpawnPoints[prefabsSpawner.GetType()]);
70 }
71
73 }
74
75 //------------------------------------------------------------------------------------------------
76 // constructor
83
84 //------------------------------------------------------------------------------------------------
85 // destructor
90}
ArmaReforgerScripted GetGame()
Definition game.c:1398
RplMode
Mode of replication.
Definition RplMode.c:9
void SCR_PrefabSpawnPoint(IEntitySource src, IEntity parent)
void ~SCR_PrefabsSpawnerManager()
void SCR_PrefabsSpawnerManager(IEntitySource src, IEntity parent)
proto external EntityEvent SetEventMask(EntityEvent e)
void EOnFrame(IEntity owner, float timeSlice)
proto external EntityEvent ClearEventMask(EntityEvent e)
Base class for Prefabs Spawning.
Definition Types.c:486
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
Definition EntityEvent.c:14