Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CaptureArea Class Reference
Inheritance diagram for SCR_CaptureArea:
SCR_CaptureAndHoldArea

Protected Member Functions

CaptureAreaEvent GetCharacterEnterInvoker ()
 Returns invoker that is invoked when a character enters this area.
CaptureAreaEvent GetCharacterExitInvoker ()
 Returns invoker that is invoked when a character exits this area.
CaptureAreaOwnershipEvent GetOwnershipChangedEvent ()
 Returns invoker that is invoked when a faction claims ownership of this area.
Faction GetOwningFaction ()
 Returns the faction that currently owns the area or null if none.
override void OnInit (IEntity owner)
 Initializes this area by initializing and preallocating required resources.
override bool RplLoad (ScriptBitReader reader)
override bool RplSave (ScriptBitWriter writer)
override bool ScriptedEntityFilterForQuery (IEntity ent)
 By default queries only for characters of SCR_ChimeraCharacter type.
override void OnActivate (IEntity ent)
 callback - activation - occurs when and entity which fulfills the filter definitions enters the Trigger
event void OnCharacterEntered (Faction faction, SCR_ChimeraCharacter character)
 Occurs when a [character] of provided [faction] enters the area.
override void OnDeactivate (IEntity ent)
 callback - deactivation - occurs when and entity which was activated (OnActivate) leaves the Trigger
event void OnCharacterExit (Faction faction, SCR_ChimeraCharacter character)
 Occurs when a [character] of provided [faction] leaves the area.
int GetOccupants (Faction faction, notnull array< SCR_ChimeraCharacter > outCharacters)
int GetOccupantsCount (Faction faction)
Faction EvaluateOwnerFaction ()
override event void OnFrame (IEntity owner, float timeSlice)
void SetOwningFactionInternalAuthority (Faction previousOwner, Faction newOwner)
 Sets internal owner faction and raises corresponding callback for clients.
void SetOwningFactionInternal (Faction previousFaction, Faction newFaction)
 Sets internal owner faction and raises corresponding callback.
void Rpc_SetOwningFaction_BC (int previousFactionIndex, int newFactionIndex)
event void OnOwningFactionChanged (Faction previousFaction, Faction newFaction)

Protected Attributes

ref map< Faction, ref array< SCR_ChimeraCharacter > > m_mOccupants = new map<Faction, ref array<SCR_ChimeraCharacter>>()
ref CaptureAreaEvent m_pOnCharacterEnter = new CaptureAreaEvent()
 Callback raised when a character enters this area.
ref CaptureAreaEvent m_pOnCharacterExit = new CaptureAreaEvent()
 Callback raised when a character leaves this area.
ref CaptureAreaOwnershipEvent m_pOnOwnershipChanged = new CaptureAreaOwnershipEvent()
 Callback raised when a new faction claims ownership of this area.
Faction m_pOwnerFaction
 The faction that currently owns this area.
RplComponent m_pRplComponent
 Replication component of this entity.

Detailed Description

Capture area is a trigger entity that provides callback and API in regards to characters entering and/or leaving the area. Characters must be assigned to a faction to be recognized by this area. In addition, the area itself must have periodic update enabled, otherwise callbacks might not be raised.

Definition at line 23 of file SCR_CaptureArea.c.

Member Function Documentation

◆ EvaluateOwnerFaction()

Faction SCR_CaptureArea::EvaluateOwnerFaction ( )
inlineprotected

Evaluate and return the faction that owns this point. Can be overridden and implemented for custom logic.

Returns the faction with most players alive in the point.

Definition at line 235 of file SCR_CaptureArea.c.

◆ GetCharacterEnterInvoker()

CaptureAreaEvent SCR_CaptureArea::GetCharacterEnterInvoker ( )
inlineprotected

Returns invoker that is invoked when a character enters this area.

Definition at line 37 of file SCR_CaptureArea.c.

◆ GetCharacterExitInvoker()

CaptureAreaEvent SCR_CaptureArea::GetCharacterExitInvoker ( )
inlineprotected

Returns invoker that is invoked when a character exits this area.

Definition at line 47 of file SCR_CaptureArea.c.

◆ GetOccupants()

int SCR_CaptureArea::GetOccupants ( Faction faction,
notnull array< SCR_ChimeraCharacter > outCharacters )
inlineprotected

Fills the provided [outCharacters] array with all occupants of provided [faction].

Parameters
factionFaction to filter for
outCharactersOutput array
Returns
Number of items output

Definition at line 207 of file SCR_CaptureArea.c.

◆ GetOccupantsCount()

int SCR_CaptureArea::GetOccupantsCount ( Faction faction)
inlineprotected

Returns the number of occupants of provided [faction].

Parameters
FactionThe faction to return the count for
Returns
Returns number of occupants

Definition at line 223 of file SCR_CaptureArea.c.

◆ GetOwnershipChangedEvent()

CaptureAreaOwnershipEvent SCR_CaptureArea::GetOwnershipChangedEvent ( )
inlineprotected

Returns invoker that is invoked when a faction claims ownership of this area.

Definition at line 57 of file SCR_CaptureArea.c.

◆ GetOwningFaction()

Faction SCR_CaptureArea::GetOwningFaction ( )
inlineprotected

Returns the faction that currently owns the area or null if none.

Definition at line 65 of file SCR_CaptureArea.c.

◆ OnActivate()

override void SCR_CaptureArea::OnActivate ( IEntity ent)
inlineprotected

callback - activation - occurs when and entity which fulfills the filter definitions enters the Trigger

Definition at line 152 of file SCR_CaptureArea.c.

◆ OnCharacterEntered()

event void SCR_CaptureArea::OnCharacterEntered ( Faction faction,
SCR_ChimeraCharacter character )
inlineprotected

Occurs when a [character] of provided [faction] enters the area.

Definition at line 174 of file SCR_CaptureArea.c.

◆ OnCharacterExit()

event void SCR_CaptureArea::OnCharacterExit ( Faction faction,
SCR_ChimeraCharacter character )
inlineprotected

Occurs when a [character] of provided [faction] leaves the area.

Definition at line 195 of file SCR_CaptureArea.c.

◆ OnDeactivate()

override void SCR_CaptureArea::OnDeactivate ( IEntity ent)
inlineprotected

callback - deactivation - occurs when and entity which was activated (OnActivate) leaves the Trigger

Definition at line 181 of file SCR_CaptureArea.c.

◆ OnFrame()

override event void SCR_CaptureArea::OnFrame ( IEntity owner,
float timeSlice )
inlineprotected

Updates the internal state of the area and reevaluates the owner.

Definition at line 269 of file SCR_CaptureArea.c.

◆ OnInit()

override void SCR_CaptureArea::OnInit ( IEntity owner)
inlineprotected

Initializes this area by initializing and preallocating required resources.

Definition at line 72 of file SCR_CaptureArea.c.

◆ OnOwningFactionChanged()

event void SCR_CaptureArea::OnOwningFactionChanged ( Faction previousFaction,
Faction newFaction )
inlineprotected

Occurs on change of faction ownership of the area.

Parameters
previousFactionFaction which held the point prior to this change or null if none.
newFactionFaction that holds the point after this change or null if none.

Definition at line 350 of file SCR_CaptureArea.c.

◆ Rpc_SetOwningFaction_BC()

void SCR_CaptureArea::Rpc_SetOwningFaction_BC ( int previousFactionIndex,
int newFactionIndex )
inlineprotected

Notifies all clients of the owning faction change. Index of faction is -1 if null.

Definition at line 329 of file SCR_CaptureArea.c.

◆ RplLoad()

override bool SCR_CaptureArea::RplLoad ( ScriptBitReader reader)
inlineprotected

Called when Item is initialized from replication stream. Carries the data from Master.

Definition at line 110 of file SCR_CaptureArea.c.

◆ RplSave()

override bool SCR_CaptureArea::RplSave ( ScriptBitWriter writer)
inlineprotected

Called when Item is getting replicated from Master to Slave connection. The data will be delivered to Slave using RplInit method.

Definition at line 127 of file SCR_CaptureArea.c.

◆ ScriptedEntityFilterForQuery()

override bool SCR_CaptureArea::ScriptedEntityFilterForQuery ( IEntity ent)
inlineprotected

By default queries only for characters of SCR_ChimeraCharacter type.

Definition at line 139 of file SCR_CaptureArea.c.

◆ SetOwningFactionInternal()

void SCR_CaptureArea::SetOwningFactionInternal ( Faction previousFaction,
Faction newFaction )
inlineprotected

Sets internal owner faction and raises corresponding callback.

Definition at line 317 of file SCR_CaptureArea.c.

◆ SetOwningFactionInternalAuthority()

void SCR_CaptureArea::SetOwningFactionInternalAuthority ( Faction previousOwner,
Faction newOwner )
inlineprotected

Sets internal owner faction and raises corresponding callback for clients.

Definition at line 307 of file SCR_CaptureArea.c.

Member Data Documentation

◆ m_mOccupants

ref map<Faction, ref array<SCR_ChimeraCharacter> > SCR_CaptureArea::m_mOccupants = new map<Faction, ref array<SCR_ChimeraCharacter>>()
protected

Map of all occupants of this area. key: Faction value: Array of characters (must be alive)

Definition at line 30 of file SCR_CaptureArea.c.

◆ m_pOnCharacterEnter

ref CaptureAreaEvent SCR_CaptureArea::m_pOnCharacterEnter = new CaptureAreaEvent()
protected

Callback raised when a character enters this area.

Definition at line 33 of file SCR_CaptureArea.c.

◆ m_pOnCharacterExit

ref CaptureAreaEvent SCR_CaptureArea::m_pOnCharacterExit = new CaptureAreaEvent()
protected

Callback raised when a character leaves this area.

Definition at line 43 of file SCR_CaptureArea.c.

◆ m_pOnOwnershipChanged

ref CaptureAreaOwnershipEvent SCR_CaptureArea::m_pOnOwnershipChanged = new CaptureAreaOwnershipEvent()
protected

Callback raised when a new faction claims ownership of this area.

Definition at line 53 of file SCR_CaptureArea.c.

◆ m_pOwnerFaction

Faction SCR_CaptureArea::m_pOwnerFaction
protected

The faction that currently owns this area.

Definition at line 63 of file SCR_CaptureArea.c.

◆ m_pRplComponent

RplComponent SCR_CaptureArea::m_pRplComponent
protected

Replication component of this entity.

Definition at line 68 of file SCR_CaptureArea.c.


The documentation for this class was generated from the following file: