Arma Reforger Script API
|
Base class for a manager of editable entities of specific state. More...
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_EditableEntityComponent > | m_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. | |
Base class for a manager of editable entities of specific state.
Attached on SCR_EntitiesManagerEditorComponent.
bool SCR_BaseEditableEntityFilter.Add | ( | notnull set< SCR_EditableEntityComponent > | entitiesInsert, |
bool | onlyDirect = false |
||
) |
Register multiple entities.
entitiesInsert | Entities to be registered |
onlyDirect | True to also include children of all affected entities |
bool SCR_BaseEditableEntityFilter.Add | ( | SCR_EditableEntityComponent | entityInsert, |
bool | onlyDirect = false |
||
) |
Register given entity.
entityInsert | Entity to be registered |
onlyDirect | True to also include children of all affected entities |
|
protected |
bool SCR_BaseEditableEntityFilter.CanAdd | ( | SCR_EditableEntityComponent | entity | ) |
Check if the entity meets condition for this entity state.
entity | Editable entity |
Implemented in SCR_CampaignBuildingEditableEntityFilter, SCR_CompatibleSlotEditableEntityFilter, SCR_ControlModeEditableEntityFilter, SCR_CurrentLayerEditableEntityFilter, SCR_DestroyedEditableEntityFilter, SCR_EntityTypesEditableEntityFilter, SCR_FriendlyEditableEntityFilter, SCR_HasFactionEditableEntityFilter, SCR_HighlightedEditableEntityFilter, SCR_LayerEditableEntityFilter, SCR_PlayerDelegateEditableEntityFilter, SCR_PlayerEditableEntityFilter, SCR_PreviewEditableEntityFilter, SCR_RenderedEditableEntityFilter, SCR_UnlockedEditableEntityFilter, and SCR_VisibleEditableEntityFilter.
bool SCR_BaseEditableEntityFilter.Clear | ( | ) |
Clear cached array.
bool SCR_BaseEditableEntityFilter.Contains | ( | SCR_EditableEntityComponent | entity | ) |
Check if given entity is among cached entities.
Implemented in SCR_DummyEditableEntityFilter.
bool SCR_BaseEditableEntityFilter.Copy | ( | SCR_BaseEditableEntityFilter | filter, |
bool | onlyDirect = false |
||
) |
Copy the list of registered entities from another filter.
filter | Filter from which the list of entities will be copied |
onlyDirect | True to also include children of all affected entities |
|
protected |
When the editor is opened (before cached array is intialized)
Implemented in SCR_CompatibleSlotEditableEntityFilter, SCR_ControlModeEditableEntityFilter, SCR_CurrentLayerEditableEntityFilter, SCR_DestroyedEditableEntityFilter, SCR_DummyEditableEntityFilter, SCR_EditedEditableEntityFilter, SCR_FriendlyEditableEntityFilter, SCR_HighlightedEditableEntityFilter, SCR_HoverEditableEntityFilter, SCR_LayerEditableEntityFilter, SCR_PingedEditableEntityFilter, SCR_PlayerEditableEntityFilter, SCR_PreviewEditableEntityFilter, SCR_RenderedEditableEntityFilter, SCR_SelectedEditableEntityFilter, SCR_UnlockedEditableEntityFilter, and SCR_VisibleEditableEntityFilter.
|
protected |
When the editor is closed (after cached array is destroyed)
Implemented in SCR_CompatibleSlotEditableEntityFilter, SCR_ControlModeEditableEntityFilter, SCR_CurrentLayerEditableEntityFilter, SCR_DestroyedEditableEntityFilter, SCR_DummyEditableEntityFilter, SCR_EditedEditableEntityFilter, SCR_FriendlyEditableEntityFilter, SCR_HighlightedEditableEntityFilter, SCR_LayerEditableEntityFilter, SCR_PingedEditableEntityFilter, SCR_PlayerEditableEntityFilter, SCR_PreviewEditableEntityFilter, SCR_RenderedEditableEntityFilter, SCR_SelectedEditableEntityFilter, SCR_UnlockedEditableEntityFilter, and SCR_VisibleEditableEntityFilter.
|
protected |
Every frame while the editor is opened.
Implemented in SCR_HoverEditableEntityFilter, and SCR_RenderedEditableEntityFilter.
EEditableEntityFilterAutoAdd SCR_BaseEditableEntityFilter.GetAutoAdd | ( | ) |
Check if entities can be registered automatically based on predecessor component.
|
protected |
|
static |
Get first entity of given filter type.
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!
[out] | entities | Array to be filled with entities |
includeChildren | True to also include all children of filtered entities (even when they don't meet filter's condition) |
Implemented in SCR_DummyEditableEntityFilter.
int SCR_BaseEditableEntityFilter.GetEntitiesCount | ( | ) |
|
protected |
Implemented in SCR_DummyEditableEntityFilter.
SCR_EditableEntityComponent SCR_BaseEditableEntityFilter.GetFirstEntity | ( | ) |
Get the first cached entity.
Implemented in SCR_DummyEditableEntityFilter.
|
static |
Get first entity of given filter type.
|
static |
Get current filter instance.
Desired | entity state |
showError | True to log a warning message when the filter was not found |
|
protected |
ScriptInvokerBase< SCR_BaseEditableEntityFilter_OnChange > SCR_BaseEditableEntityFilter.GetOnChanged | ( | ) |
Get script invoker which is triggered every time some entities are added or removed.
Implemented in SCR_DummyEditableEntityFilter.
|
protected |
SCR_BaseEditableEntityFilter SCR_BaseEditableEntityFilter.GetPredecessor | ( | ) |
Get component which preceeds this one.
EEditableEntityState SCR_BaseEditableEntityFilter.GetPredecessorState | ( | ) |
Get entity state of the component which preceeds this one.
EEditableEntityState SCR_BaseEditableEntityFilter.GetState | ( | ) |
Get entity state this component is managing.
string SCR_BaseEditableEntityFilter.GetStateName | ( | ) |
Get name of the entity state this component is managing.
|
protected |
Implemented in SCR_DummyEditableEntityFilter.
void SCR_BaseEditableEntityFilter.InitVariables | ( | SCR_EntitiesManagerEditorComponent | manager, |
SCR_BaseEditableEntityFilter | predecessor | ||
) |
|
protected |
bool SCR_BaseEditableEntityFilter.IsEmpty | ( | ) |
Check if the filter contains any entities.
void SCR_BaseEditableEntityFilter.Log | ( | ) |
Print all cached entities to the log.
void SCR_BaseEditableEntityFilter.OnActivateBase | ( | ) |
|
protected |
|
protected |
Implemented in SCR_DestroyedEditableEntityFilter.
void SCR_BaseEditableEntityFilter.OnDeactivateBase | ( | ) |
void SCR_BaseEditableEntityFilter.OnFrameBase | ( | float | timeSlice | ) |
bool SCR_BaseEditableEntityFilter.Remove | ( | notnull set< SCR_EditableEntityComponent > | entitiesRemove, |
bool | onlyDirect = false |
||
) |
Unregister multiple entities.
entitiesRemove | Entities to be unregistered |
onlyDirect | True to also include children of all affected entities |
bool SCR_BaseEditableEntityFilter.Remove | ( | SCR_EditableEntityComponent | entityRemove, |
bool | onlyDirect = false |
||
) |
Unregister given entity.
entityRemove | Entity to be unregistered |
onlyDirect | True to also include children of all affected entities |
|
protected |
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.
entityInsert | Entity to be registered |
onlyDirect | True to also include children of all affected entities \para, keepExisting True to keep all already listed entities, provided they still pass filter condition |
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.
entitiesInsert | Entities to be registered |
onlyDirect | True to also include children of all affected entities \para, keepExisting True to keep all already listed entities, provided they still pass filter condition |
bool SCR_BaseEditableEntityFilter.Set | ( | SCR_EditableEntityComponent | entityInsert, |
SCR_EditableEntityComponent | entityRemove, | ||
bool | onlyDirect = false |
||
) |
Register and unregister entities in one go.
entityInsert | Entity to be registered |
entityRemove | Entity to be unregistered |
onlyDirect | True to also include children of all affected entities |
bool SCR_BaseEditableEntityFilter.Set | ( | set< SCR_EditableEntityComponent > | entitiesInsert, |
set< SCR_EditableEntityComponent > | entitiesRemove, | ||
bool | onlyDirect = false |
||
) |
Register and unregister entities in one go.
entitiesInsert | Entities to be registered |
entitiesRemove | Entities to be unregistered |
onlyDirect | True to also include children of all affected entities |
bool SCR_BaseEditableEntityFilter.SetFromPredecessor | ( | ) |
Fill the list from the predecessor.
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.
entities | Affected entities |
onlyDirect | True to also include children of all affected entities |
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.
entity | Affected entity |
onlyDirect | True to also include children of all affected entities |
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.
entity | Queried entity |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |