Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AISettingsBaseComponent.c File Reference

Go to the source code of this file.

Classes

class  SCR_AISettingsBaseComponentClass

Functions

override void OnPostInit (IEntity owner)
 Editable Mine.
bool AddSetting (notnull SCR_AISettingBase setting, bool createCopy, bool removeSameTypeAndOrigin=false)
bool RemoveSetting (notnull SCR_AISettingBase setting)
bool RemoveChildSettingsOfParent (notnull SCR_AISettingBase parentSetting)
 Removes setting which has provided setting object as parent.
void RemoveSettingsWithFlag (SCR_EAISettingFlags f)
 Iterates all settings, removes all which have given flag.
void RemoveSettingsOfTypeAndOrigin (typename t, SCR_EAISettingOrigin origin)
 typename t - must be one of those returned by GetCategorizationType
SCR_AISettingBase GetCurrentSetting (typename settingType)
SCR_AISettingBase GetCurrentSetting (typename settingType, int currentActionCause)
void GetAllSettings (notnull array< SCR_AISettingBase > outSettings)
 Returns all setting objects held by this component.
void OnSettingRemoved (notnull SCR_AISettingBase setting)
void OnSettingAdded (notnull SCR_AISettingBase setting)

Variables

SCR_AISettingsBaseComponentClass typename
SCR_AISettingsBaseComponentClass m_mSettings = new map<typename, ref array<ref SCR_AISettingBase>>()
AIBaseUtilityComponent m_UtilityComp

Function Documentation

◆ AddSetting()

bool AddSetting ( notnull SCR_AISettingBase setting,
bool createCopy,
bool removeSameTypeAndOrigin = false )
protected

Adds setting object. Depending on createCopy value, from now on it will be owned by this component, or it will create a copy which will be owned by this component. It's protected. Instead use Add...Setting of derived class. createCopy - when true, a copy of the setting object will be created. When false, this component takes ownership of passed setting object. If you want to add same setting to many agents, always add it with createCopy=true, or make a copy yourself. removeSameTypeAndOrigin - if true, removes all settings which have same categorization type and origin.

Definition at line 42 of file SCR_AISettingsBaseComponent.c.

◆ GetAllSettings()

void GetAllSettings ( notnull array< SCR_AISettingBase > outSettings)
protected

Returns all setting objects held by this component.

Definition at line 246 of file SCR_AISettingsBaseComponent.c.

◆ GetCurrentSetting() [1/2]

SCR_AISettingBase GetCurrentSetting ( typename settingType )
protected

Returns current setting based on type and cause value of current action typename settingType - must be one of those returned by GetCategorizationType

Definition at line 210 of file SCR_AISettingsBaseComponent.c.

◆ GetCurrentSetting() [2/2]

SCR_AISettingBase GetCurrentSetting ( typename settingType ,
int currentActionCause )
protected

Returns current setting based on type and cause value typename settingType - must be one of those returned by GetCategorizationType

Definition at line 227 of file SCR_AISettingsBaseComponent.c.

◆ OnSettingAdded()

void OnSettingAdded ( notnull SCR_AISettingBase setting)
protected

Definition at line 30 of file SCR_AIGroupSettingsComponent.c.

◆ OnSettingRemoved()

void OnSettingRemoved ( notnull SCR_AISettingBase setting)
protected

Definition at line 38 of file SCR_AIGroupSettingsComponent.c.

◆ RemoveChildSettingsOfParent()

bool RemoveChildSettingsOfParent ( notnull SCR_AISettingBase parentSetting)
protected

Removes setting which has provided setting object as parent.

Definition at line 125 of file SCR_AISettingsBaseComponent.c.

◆ RemoveSetting()

bool RemoveSetting ( notnull SCR_AISettingBase setting)
protected

Definition at line 96 of file SCR_AISettingsBaseComponent.c.

◆ RemoveSettingsOfTypeAndOrigin()

void RemoveSettingsOfTypeAndOrigin ( typename t ,
SCR_EAISettingOrigin origin )
protected

typename t - must be one of those returned by GetCategorizationType

Definition at line 185 of file SCR_AISettingsBaseComponent.c.

◆ RemoveSettingsWithFlag()

void RemoveSettingsWithFlag ( SCR_EAISettingFlags f)
protected

Iterates all settings, removes all which have given flag.

Definition at line 162 of file SCR_AISettingsBaseComponent.c.

Variable Documentation

◆ m_mSettings

SCR_AISettingsBaseComponentClass m_mSettings = new map<typename, ref array<ref SCR_AISettingBase>>()

◆ m_UtilityComp

AIBaseUtilityComponent m_UtilityComp
protected

Definition at line 26 of file SCR_AISettingsBaseComponent.c.

◆ typename

Base class for storing settings individual AI Agents.

It solves following tasks:

  • It stores setting objects.
  • Setting objects are categorized by their type, for easier lookup.
  • Setting objects of each type are sorted by their priority. This allows multiple game systems provide their value of same type of AI settings, without affecting value provided by other game systems. For example, AI Commanding, Scenario Framework and Editor both might want to affect AI stance setting.
  • Underlying AI systems are supposed to call GetCurrentSetting to find currently active AI setting of given type.
  • Alternatively it can work the opposite way: setting objects can propagate data into underlying parts of AI. It depends on how Setting class is configured.