Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SCR_BaseEditableEntityFilter Interface Reference

Base class for a manager of editable entities of specific state. More...

Inheritance diagram for SCR_BaseEditableEntityFilter:
[legend]

Public Member Functions

void InitVariables (SCR_EntitiesManagerEditorComponent manager, SCR_BaseEditableEntityFilter predecessor)
 
EEditableEntityState GetState ()
 Get entity state this component is managing.
 
string GetStateName ()
 Get name of the entity state this component is managing.
 
EEditableEntityState GetPredecessorState ()
 Get entity state of the component which preceeds this one.
 
SCR_BaseEditableEntityFilter GetPredecessor ()
 Get component which preceeds this one.
 
EEditableEntityFilterAutoAdd GetAutoAdd ()
 Check if entities can be registered automatically based on predecessor component.
 
int GetEntities (out set< SCR_EditableEntityComponent > entities, bool includeChildren=false, bool evaluate=true)
 Get entities managed by this filter.
 
int GetEntitiesCount ()
 Get number of cached entities.
 
bool IsEmpty ()
 Check if the filter contains any entities.
 
SCR_EditableEntityComponent GetFirstEntity ()
 Get the first cached entity.
 
bool Contains (SCR_EditableEntityComponent entity)
 Check if given entity is among cached entities.
 
ScriptInvokerBase< SCR_BaseEditableEntityFilter_OnChange > GetOnChanged ()
 Get script invoker which is triggered every time some entities are added or removed.
 
void Log ()
 Print all cached entities to the log.
 
void OnFrameBase (float timeSlice)
 
void OnActivateBase ()
 
void OnDeactivateBase ()
 
Array Manipulation Functions

Functions to add or remove entities to the cached array.

bool Add (SCR_EditableEntityComponent entityInsert, bool onlyDirect=false)
 Register given entity.
 
bool Add (notnull set< SCR_EditableEntityComponent > entitiesInsert, bool onlyDirect=false)
 Register multiple entities.
 
bool Remove (SCR_EditableEntityComponent entityRemove, bool onlyDirect=false)
 Unregister given entity.
 
bool Remove (notnull set< SCR_EditableEntityComponent > entitiesRemove, bool onlyDirect=false)
 Unregister multiple entities.
 
bool Toggle (SCR_EditableEntityComponent entity, bool onlyDirect=false)
 Toggle state of given entity, i.e., register it if it's unregistered and unregister it if it's registered.
 
bool Toggle (notnull set< SCR_EditableEntityComponent > entities, bool onlyDirect=false)
 Toggle state of given entities, i.e., register them if they're unregistered and unregister them if they're registered.
 
bool Replace (SCR_EditableEntityComponent entityInsert, bool onlyDirect=false, bool keepExisting=false)
 Replace cached array with given entity.
 
bool Replace (set< SCR_EditableEntityComponent > entitiesInsert, bool onlyDirect=false, bool keepExisting=false)
 Replace cached array with entities.
 
bool Set (SCR_EditableEntityComponent entityInsert, SCR_EditableEntityComponent entityRemove, bool onlyDirect=false)
 Register and unregister entities in one go.
 
bool Set (set< SCR_EditableEntityComponent > entitiesInsert, set< SCR_EditableEntityComponent > entitiesRemove, bool onlyDirect=false)
 Register and unregister entities in one go.
 
bool SetFromPredecessor ()
 Fill the list from the predecessor.
 
bool Validate (SCR_EditableEntityComponent entity)
 If the entity is added to the filter, check if its condition is still valid.
 
bool Clear ()
 Clear cached array.
 
bool Copy (SCR_BaseEditableEntityFilter filter, bool onlyDirect=false)
 Copy the list of registered entities from another filter.
 

Static Public Member Functions

static SCR_BaseEditableEntityFilter GetInstance (EEditableEntityState state, bool showError=false)
 Get current filter instance.
 
static SCR_EditableEntityComponent GetFirstEntity (EEditableEntityState state)
 Get first entity of given filter type.
 
static int GetEnititiesStatic (out set< SCR_EditableEntityComponent > entities, EEditableEntityState state, bool includeChildren=false, bool evaluate=true)
 Get first entity of given filter type.
 

Protected Member Functions

int GetEntitiesPointer (out set< SCR_EditableEntityComponent > entities)
 
SCR_EditableEntityComponent GetParentBelowCurrentLayer (SCR_EditableEntityComponent entity)
 
sealed SCR_EntitiesManagerEditorComponent GetManager ()
 
sealed SCR_EditableEntityCore GetCore ()
 
void InitEntities ()
 
void OnChanged (set< SCR_EditableEntityComponent > entitiesInsert, set< SCR_EditableEntityComponent > entitiesRemove)
 
void OnChanged ()
 
sealed void InsertChildren (out set< SCR_EditableEntityComponent > entities)
 
sealed bool AddToArray (SCR_EditableEntityComponent entity, out bool isChange, bool returnWhenExists=false)
 
sealed bool RemoveFromArray (SCR_EditableEntityComponent entity, out bool isChange)
 

Protected Attributes

EEditableEntityState m_State
 
EEditableEntityState m_PredecessorState
 
EEditableEntityFilterAutoAdd m_bAutoAdd
 
bool m_bSkipIgnored
 
bool m_bOnlyInteractive
 
SCR_EditableEntityCore m_Core
 
SCR_EntitiesManagerEditorComponent m_Manager
 
SCR_BaseEditableEntityFilter m_Predecessor
 
ref set< SCR_EditableEntityComponentm_Entities
 
int m_iEntitiesCount
 
string m_sStateName = "N/A"
 
ref ScriptInvokerBase< SCR_BaseEditableEntityFilter_OnChange > m_OnChange = new ScriptInvokerBase<SCR_BaseEditableEntityFilter_OnChange>()
 

Override Functions

Functions to be overridden by child classes (all of them local to the editor owner).

bool CanAdd (SCR_EditableEntityComponent entity)
 Check if the entity meets condition for this entity state.
 
void EOnEditorActivate ()
 When the editor is opened (before cached array is intialized)
 
void EOnEditorDeactivate ()
 When the editor is closed (after cached array is destroyed)
 
void EOnEditorFrame (float timeSlice)
 Every frame while the editor is opened.
 

Detailed Description

Base class for a manager of editable entities of specific state.

Attached on SCR_EntitiesManagerEditorComponent.

Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.1/A4Data/scripts/Game/Editor/Containers/EditableEntityFilters/SCR_RenderedEditableEntityFilter.c.

Member Function Documentation

◆ Add() [1/2]

bool SCR_BaseEditableEntityFilter.Add ( notnull set< SCR_EditableEntityComponent entitiesInsert,
bool  onlyDirect = false 
)

Register multiple entities.

Parameters
entitiesInsertEntities to be registered
onlyDirectTrue to also include children of all affected entities
Returns
True if cached array changed

◆ Add() [2/2]

bool SCR_BaseEditableEntityFilter.Add ( SCR_EditableEntityComponent  entityInsert,
bool  onlyDirect = false 
)

Register given entity.

Parameters
entityInsertEntity to be registered
onlyDirectTrue to also include children of all affected entities
Returns
True if cached array changed
Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.1/A4Data/scripts/Game/Editor/Containers/EditableEntityFilters/SCR_RenderedEditableEntityFilter.c.

◆ AddToArray()

sealed bool SCR_BaseEditableEntityFilter.AddToArray ( SCR_EditableEntityComponent  entity,
out bool  isChange,
bool  returnWhenExists = false 
)
protected

◆ CanAdd()

bool SCR_BaseEditableEntityFilter.CanAdd ( SCR_EditableEntityComponent  entity)

◆ Clear()

bool SCR_BaseEditableEntityFilter.Clear ( )

Clear cached array.

Returns
True if the array changed

◆ Contains()

bool SCR_BaseEditableEntityFilter.Contains ( SCR_EditableEntityComponent  entity)

Check if given entity is among cached entities.

Returns
True if registered

Implemented in SCR_DummyEditableEntityFilter.

◆ Copy()

bool SCR_BaseEditableEntityFilter.Copy ( SCR_BaseEditableEntityFilter  filter,
bool  onlyDirect = false 
)

Copy the list of registered entities from another filter.

Parameters
filterFilter from which the list of entities will be copied
onlyDirectTrue to also include children of all affected entities
Returns
True if cached array changed

◆ EOnEditorActivate()

void SCR_BaseEditableEntityFilter.EOnEditorActivate ( )
protected

◆ EOnEditorDeactivate()

void SCR_BaseEditableEntityFilter.EOnEditorDeactivate ( )
protected

◆ EOnEditorFrame()

void SCR_BaseEditableEntityFilter.EOnEditorFrame ( float  timeSlice)
protected

Every frame while the editor is opened.

Implemented in SCR_HoverEditableEntityFilter, and SCR_RenderedEditableEntityFilter.

◆ GetAutoAdd()

EEditableEntityFilterAutoAdd SCR_BaseEditableEntityFilter.GetAutoAdd ( )

Check if entities can be registered automatically based on predecessor component.

Returns
True if automatic adding is enabled

◆ GetCore()

sealed SCR_EditableEntityCore SCR_BaseEditableEntityFilter.GetCore ( )
protected

◆ GetEnititiesStatic()

static int SCR_BaseEditableEntityFilter.GetEnititiesStatic ( out set< SCR_EditableEntityComponent entities,
EEditableEntityState  state,
bool  includeChildren = false,
bool  evaluate = true 
)
static

Get first entity of given filter type.

Returns
Editable entity

◆ GetEntities()

int SCR_BaseEditableEntityFilter.GetEntities ( out set< SCR_EditableEntityComponent entities,
bool  includeChildren = false,
bool  evaluate = true 
)

Get entities managed by this filter.

When the editor is opened, cached array is returned. When the editor is closed, the array is re-calculated based on conditions of this component and all its predecessors. Use sparingly!

Parameters
[out]entitiesArray to be filled with entities
includeChildrenTrue to also include all children of filtered entities (even when they don't meet filter's condition)
Returns
Number of filtered entities

Implemented in SCR_DummyEditableEntityFilter.

Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.1/A4Data/scripts/Game/Editor/Containers/EditableEntityFilters/SCR_RenderedEditableEntityFilter.c.

◆ GetEntitiesCount()

int SCR_BaseEditableEntityFilter.GetEntitiesCount ( )

Get number of cached entities.

Returns
Entity count

Implemented in SCR_DummyEditableEntityFilter.

◆ GetEntitiesPointer()

int SCR_BaseEditableEntityFilter.GetEntitiesPointer ( out set< SCR_EditableEntityComponent entities)
protected

◆ GetFirstEntity() [1/2]

SCR_EditableEntityComponent SCR_BaseEditableEntityFilter.GetFirstEntity ( )

Get the first cached entity.

Returns
Entity. When no entity is registered or no array is cached, null is returned.

Implemented in SCR_DummyEditableEntityFilter.

◆ GetFirstEntity() [2/2]

static SCR_EditableEntityComponent SCR_BaseEditableEntityFilter.GetFirstEntity ( EEditableEntityState  state)
static

Get first entity of given filter type.

Returns
Editable entity

◆ GetInstance()

static SCR_BaseEditableEntityFilter SCR_BaseEditableEntityFilter.GetInstance ( EEditableEntityState  state,
bool  showError = false 
)
static

Get current filter instance.

Parameters
Desiredentity state
showErrorTrue to log a warning message when the filter was not found
Returns
Entity state

◆ GetManager()

sealed SCR_EntitiesManagerEditorComponent SCR_BaseEditableEntityFilter.GetManager ( )
protected

◆ GetOnChanged()

ScriptInvokerBase< SCR_BaseEditableEntityFilter_OnChange > SCR_BaseEditableEntityFilter.GetOnChanged ( )

Get script invoker which is triggered every time some entities are added or removed.

Returns
Script invoker

Implemented in SCR_DummyEditableEntityFilter.

◆ GetParentBelowCurrentLayer()

SCR_EditableEntityComponent SCR_BaseEditableEntityFilter.GetParentBelowCurrentLayer ( SCR_EditableEntityComponent  entity)
protected

◆ GetPredecessor()

SCR_BaseEditableEntityFilter SCR_BaseEditableEntityFilter.GetPredecessor ( )

◆ GetPredecessorState()

EEditableEntityState SCR_BaseEditableEntityFilter.GetPredecessorState ( )

Get entity state of the component which preceeds this one.

Returns
Entity state

◆ GetState()

EEditableEntityState SCR_BaseEditableEntityFilter.GetState ( )

◆ GetStateName()

string SCR_BaseEditableEntityFilter.GetStateName ( )

Get name of the entity state this component is managing.

Returns
Entity state name

◆ InitEntities()

void SCR_BaseEditableEntityFilter.InitEntities ( )
protected

◆ InitVariables()

void SCR_BaseEditableEntityFilter.InitVariables ( SCR_EntitiesManagerEditorComponent  manager,
SCR_BaseEditableEntityFilter  predecessor 
)

◆ InsertChildren()

sealed void SCR_BaseEditableEntityFilter.InsertChildren ( out set< SCR_EditableEntityComponent entities)
protected

◆ IsEmpty()

bool SCR_BaseEditableEntityFilter.IsEmpty ( )

Check if the filter contains any entities.

Returns
True when empty

◆ Log()

void SCR_BaseEditableEntityFilter.Log ( )

Print all cached entities to the log.

◆ OnActivateBase()

void SCR_BaseEditableEntityFilter.OnActivateBase ( )

◆ OnChanged() [1/2]

void SCR_BaseEditableEntityFilter.OnChanged ( )
protected

◆ OnChanged() [2/2]

void SCR_BaseEditableEntityFilter.OnChanged ( set< SCR_EditableEntityComponent entitiesInsert,
set< SCR_EditableEntityComponent entitiesRemove 
)
protected

◆ OnDeactivateBase()

void SCR_BaseEditableEntityFilter.OnDeactivateBase ( )

◆ OnFrameBase()

void SCR_BaseEditableEntityFilter.OnFrameBase ( float  timeSlice)

◆ Remove() [1/2]

bool SCR_BaseEditableEntityFilter.Remove ( notnull set< SCR_EditableEntityComponent entitiesRemove,
bool  onlyDirect = false 
)

Unregister multiple entities.

Parameters
entitiesRemoveEntities to be unregistered
onlyDirectTrue to also include children of all affected entities
Returns
True if cached array changed

◆ Remove() [2/2]

bool SCR_BaseEditableEntityFilter.Remove ( SCR_EditableEntityComponent  entityRemove,
bool  onlyDirect = false 
)

Unregister given entity.

Parameters
entityRemoveEntity to be unregistered
onlyDirectTrue to also include children of all affected entities
Returns
True if cached array changed
Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.1/A4Data/scripts/Game/Editor/Containers/EditableEntityFilters/SCR_RenderedEditableEntityFilter.c.

◆ RemoveFromArray()

sealed bool SCR_BaseEditableEntityFilter.RemoveFromArray ( SCR_EditableEntityComponent  entity,
out bool  isChange 
)
protected

◆ Replace() [1/2]

bool SCR_BaseEditableEntityFilter.Replace ( SCR_EditableEntityComponent  entityInsert,
bool  onlyDirect = false,
bool  keepExisting = false 
)

Replace cached array with given entity.

ALl currently registered entities will be removed.

Parameters
entityInsertEntity to be registered
onlyDirectTrue to also include children of all affected entities \para, keepExisting True to keep all already listed entities, provided they still pass filter condition
Returns
True if cached array changed

◆ Replace() [2/2]

bool SCR_BaseEditableEntityFilter.Replace ( set< SCR_EditableEntityComponent entitiesInsert,
bool  onlyDirect = false,
bool  keepExisting = false 
)

Replace cached array with entities.

ALl currently registered entities will be removed.

Parameters
entitiesInsertEntities to be registered
onlyDirectTrue to also include children of all affected entities \para, keepExisting True to keep all already listed entities, provided they still pass filter condition
Returns
True if cached array changed

◆ Set() [1/2]

bool SCR_BaseEditableEntityFilter.Set ( SCR_EditableEntityComponent  entityInsert,
SCR_EditableEntityComponent  entityRemove,
bool  onlyDirect = false 
)

Register and unregister entities in one go.

Parameters
entityInsertEntity to be registered
entityRemoveEntity to be unregistered
onlyDirectTrue to also include children of all affected entities
Returns
True if cached array changed

◆ Set() [2/2]

bool SCR_BaseEditableEntityFilter.Set ( set< SCR_EditableEntityComponent entitiesInsert,
set< SCR_EditableEntityComponent entitiesRemove,
bool  onlyDirect = false 
)

Register and unregister entities in one go.

Parameters
entitiesInsertEntities to be registered
entitiesRemoveEntities to be unregistered
onlyDirectTrue to also include children of all affected entities
Returns
True if cached array changed

◆ SetFromPredecessor()

bool SCR_BaseEditableEntityFilter.SetFromPredecessor ( )

Fill the list from the predecessor.

Returns
True if cached array changed

◆ Toggle() [1/2]

bool SCR_BaseEditableEntityFilter.Toggle ( notnull set< SCR_EditableEntityComponent entities,
bool  onlyDirect = false 
)

Toggle state of given entities, i.e., register them if they're unregistered and unregister them if they're registered.

Parameters
entitiesAffected entities
onlyDirectTrue to also include children of all affected entities
Returns
True if cached array changed

◆ Toggle() [2/2]

bool SCR_BaseEditableEntityFilter.Toggle ( SCR_EditableEntityComponent  entity,
bool  onlyDirect = false 
)

Toggle state of given entity, i.e., register it if it's unregistered and unregister it if it's registered.

Parameters
entityAffected entity
onlyDirectTrue to also include children of all affected entities
Returns
True if cached array changed

◆ Validate()

bool SCR_BaseEditableEntityFilter.Validate ( SCR_EditableEntityComponent  entity)

If the entity is added to the filter, check if its condition is still valid.

If not, remove the entity.

Parameters
entityQueried entity
Returns
True if the array changed

Member Data Documentation

◆ m_bAutoAdd

EEditableEntityFilterAutoAdd SCR_BaseEditableEntityFilter.m_bAutoAdd
protected

◆ m_bOnlyInteractive

bool SCR_BaseEditableEntityFilter.m_bOnlyInteractive
protected

◆ m_bSkipIgnored

bool SCR_BaseEditableEntityFilter.m_bSkipIgnored
protected

◆ m_Core

SCR_EditableEntityCore SCR_BaseEditableEntityFilter.m_Core
protected

◆ m_Entities

ref set<SCR_EditableEntityComponent> SCR_BaseEditableEntityFilter.m_Entities
protected

◆ m_iEntitiesCount

int SCR_BaseEditableEntityFilter.m_iEntitiesCount
protected

◆ m_Manager

SCR_EntitiesManagerEditorComponent SCR_BaseEditableEntityFilter.m_Manager
protected

◆ m_OnChange

ref ScriptInvokerBase<SCR_BaseEditableEntityFilter_OnChange> SCR_BaseEditableEntityFilter.m_OnChange = new ScriptInvokerBase<SCR_BaseEditableEntityFilter_OnChange>()
protected

◆ m_Predecessor

SCR_BaseEditableEntityFilter SCR_BaseEditableEntityFilter.m_Predecessor
protected

◆ m_PredecessorState

EEditableEntityState SCR_BaseEditableEntityFilter.m_PredecessorState
protected

◆ m_sStateName

string SCR_BaseEditableEntityFilter.m_sStateName = "N/A"
protected

◆ m_State

EEditableEntityState SCR_BaseEditableEntityFilter.m_State
protected

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