Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CharacterRegistrationComponent.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/Components", description: "Registers characters and holds them in an array.", color: "0 0 255 255")]
2 class SCR_CharacterRegistrationComponentClass : ScriptComponentClass
3 {
4 }
5 
7 {
8  protected static ref array<SCR_ChimeraCharacter> s_aChimeraCharacters = {};
9 
10  protected IEntity m_owner;
11 
12  //------------------------------------------------------------------------------------------------
14  static array<SCR_ChimeraCharacter> GetChimeraCharacters()
15  {
16  return s_aChimeraCharacters;
17  }
18 
19  //------------------------------------------------------------------------------------------------
20  override void OnDelete(IEntity owner)
21  {
23  return;
24 
25  SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(owner);
26  if (character && s_aChimeraCharacters.Find(character) != -1)
27  s_aChimeraCharacters.RemoveItem(character);
28  }
29 
30  //------------------------------------------------------------------------------------------------
31  override void OnPostInit(IEntity owner)
32  {
33  m_owner = owner;
34 
36  return;
37 
38  SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(owner);
39  if (character)
40  s_aChimeraCharacters.Insert(character);
41  }
42 
43  //------------------------------------------------------------------------------------------------
44  // constructor
48  void SCR_CharacterRegistrationComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
49  {
50  }
51 
52  //------------------------------------------------------------------------------------------------
53  // destructor
55  {
56  SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(m_owner);
57  if (character && s_aChimeraCharacters.Find(character) != -1)
58  s_aChimeraCharacters.RemoveItem(character);
59  }
60 }
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
ScriptComponent
SCR_SiteSlotEntityClass ScriptComponent
~SCR_CharacterRegistrationComponent
void ~SCR_CharacterRegistrationComponent()
Definition: SCR_CharacterRegistrationComponent.c:54
s_aChimeraCharacters
SCR_CharacterRegistrationComponentClass s_aChimeraCharacters
OnDelete
override void OnDelete(IEntity owner)
Definition: SCR_CharacterRegistrationComponent.c:20
m_owner
protected IEntity m_owner
Definition: SCR_CharacterRegistrationComponent.c:10
SCR_CharacterRegistrationComponentClass
Definition: SCR_CharacterRegistrationComponent.c:2
SCR_CharacterRegistrationComponent
void SCR_CharacterRegistrationComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_CharacterRegistrationComponent.c:48
OnPostInit
override void OnPostInit(IEntity owner)
Called on PostInit when all components are added.
Definition: SCR_CharacterRegistrationComponent.c:31
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180