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_SpawnPositionComponentManager.c
Go to the documentation of this file.
1
[
EntityEditorProps
(insertable:
false
)]
2
class
SCR_SpawnPositionComponentManagerClass
: GenericEntityClass
3
{
4
}
5
6
class
SCR_SpawnPositionComponentManager :
GenericEntity
7
{
8
protected
static
SCR_SpawnPositionComponentManager s_Instance;
9
protected
ref array<SCR_SpawnPositionComponent>
m_aSpawnPositions
;
10
11
//------------------------------------------------------------------------------------------------
14
static
SCR_SpawnPositionComponentManager GetInstance(
bool
createNew =
true
)
15
{
16
if
(!s_Instance && createNew)
17
s_Instance = SCR_SpawnPositionComponentManager.Cast(
GetGame
().
SpawnEntity
(SCR_SpawnPositionComponentManager,
GetGame
().GetWorld()));
18
19
return
s_Instance;
20
}
21
22
//------------------------------------------------------------------------------------------------
25
void
AddSpawnPosition
(SCR_SpawnPositionComponent positionComp)
26
{
27
if
(!
m_aSpawnPositions
)
28
m_aSpawnPositions
= {};
29
30
if
(!
m_aSpawnPositions
.Contains(positionComp))
31
m_aSpawnPositions
.Insert(positionComp);
32
}
33
34
//------------------------------------------------------------------------------------------------
37
void
DeleteSpawnPosition
(SCR_SpawnPositionComponent positionComp)
38
{
39
if
(!
m_aSpawnPositions
)
40
return
;
41
42
m_aSpawnPositions
.RemoveItem(positionComp);
43
44
if
(
m_aSpawnPositions
.IsEmpty())
45
m_aSpawnPositions
= null;
46
}
47
48
//------------------------------------------------------------------------------------------------
53
int
GetSpawnPositionsInRange
(
vector
center,
float
range, out array<SCR_SpawnPositionComponent> positions)
54
{
55
if
(!
m_aSpawnPositions
)
56
return
0;
57
58
float
rangeSq = range * range;
59
foreach
(SCR_SpawnPositionComponent
position
:
m_aSpawnPositions
)
60
{
61
if
(
vector
.DistanceSq(
position
.GetOwner().GetOrigin(), center) <= rangeSq)
62
positions.Insert(
position
);
63
}
64
65
return
positions.Count();
66
}
67
68
//------------------------------------------------------------------------------------------------
69
// destructor
70
void
~SCR_SpawnPositionComponentManager
()
71
{
72
if
(s_Instance ==
this
)
73
s_Instance = null;
74
}
75
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
SpawnEntity
IEntity SpawnEntity(ResourceName entityResourceName, notnull IEntity slotOwner)
Definition
SCR_CatalogEntitySpawnerComponent.c:1008
EntityEditorProps
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Definition
SCR_CompassComponent.c:10
position
vector position
Definition
SCR_DestructibleTreeV2.c:30
m_aSpawnPositions
ref array< SCR_SpawnPositionComponent > m_aSpawnPositions
Definition
SCR_SpawnPositionComponentManager.c:9
GetSpawnPositionsInRange
int GetSpawnPositionsInRange(vector center, float range, out array< SCR_SpawnPositionComponent > positions)
Definition
SCR_SpawnPositionComponentManager.c:53
AddSpawnPosition
void AddSpawnPosition(SCR_SpawnPositionComponent positionComp)
Definition
SCR_SpawnPositionComponentManager.c:25
DeleteSpawnPosition
void DeleteSpawnPosition(SCR_SpawnPositionComponent positionComp)
Definition
SCR_SpawnPositionComponentManager.c:37
~SCR_SpawnPositionComponentManager
void ~SCR_SpawnPositionComponentManager()
Definition
SCR_SpawnPositionComponentManager.c:70
GenericEntity
Definition
GenericEntity.c:16
SCR_SpawnPositionComponentManagerClass
Definition
SCR_SpawnPositionComponentManager.c:3
vector
Definition
vector.c:13
scripts
Game
GameMode
Respawn
SCR_SpawnPositionComponentManager.c
Generated by
1.17.0