Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_ResourceContainer Interface Reference
Inheritance diagram for SCR_ResourceContainer:
SCR_ResourceActor SCR_ResourceContainerVirtual

Public Member Functions

float GetResourceValue ()
 
float GetMaxResourceValue ()
 
float GetWeightMultiplier ()
 
float GetResourceGain ()
 
float GetResourceDecay ()
 
float GetResourceGainTickrate ()
 
float GetResourceDecayTickrate ()
 
void GetBoundingVolume (inout vector mins, inout vector maxs)
 
void GetAxisAlignedBoundingVolume (inout vector mins, inout vector maxs)
 
EResourceContainerStorageType GetStorageType ()
 
EResourceType GetResourceType ()
 
EResourceContainerOnEmptyBehavior GetOnEmptyBehavior ()
 
SCR_ResourceEncapsulator GetResourceEncapsulator ()
 
set< SCR_ResourceInteractorGetLinkedInteractors ()
 
array< SCR_ResourceInteractorGetLinkedInteractorsCopy ()
 
int GetLinkedInteractorsCount ()
 
SCR_ResourceInteractor GetLinkedInteractorAt (int index)
 
int GetLinkedInteractorIndex (notnull SCR_ResourceInteractor interactor)
 
WorldTimestamp GetLastUpdateTimestamp ()
 Returns the timestamp that is aimed to be used for the computation of gain and decay.
 
bool IsInteractorLinked (notnull SCR_ResourceInteractor interactor)
 
bool IsAllowed (notnull SCR_ResourceInteractor interactor)
 
override bool IsIsolated ()
 
bool IsInRange (vector origin, float range)
 
bool IsResourceDecayEnabled ()
 
bool IsResourceGainEnabled ()
 
bool IsEncapsulated ()
 
override bool ShouldUpdate ()
 
bool IsAllowedToStoreResource ()
 
bool CanStoreResource ()
 
ScriptInvoker GetOnResourcesChanged ()
 
ScriptInvoker GetOnMaxResourcesChanged ()
 
ScriptInvoker GetOnResourcesDepleted ()
 
ScriptInvoker GetOnResourcesMaxedOut ()
 
ScriptInvoker GetOnGainChanged ()
 
ScriptInvoker GetOnDecayChanged ()
 
ScriptInvoker GetOnGainEnabledChanged ()
 
ScriptInvoker GetOnDecayEnabledChanged ()
 
void SetLastUpdateTimestamp (WorldTimestamp timestamp)
 Sets the timestamp that is aimed to be used for the computation of gain and decay.
 
bool SetResourceValue (float value, bool notifyChange=true)
 Sets the resource value of the container to the specified value, clamped to the maximum resource value.
 
bool SetResourceValueUnsafe (float value, bool notifyChange=true)
 Unsafely sets the resource value of the container to the specified value, clamped to the maximum resource value.
 
bool SetMaxResourceValue (float value, bool notifyChange=true)
 
bool SetResourceGain (float value, bool notifyChange=true)
 
bool SetResourceDecay (float value, bool notifyChange=true)
 
void SetResourceGainTickrate (float tickrate)
 
void SetResourceDecayTickrate (float tickrate)
 
void SetResourceGainTimeout (float timeout)
 
void SetResourceDecayTimeout (float timeout)
 
void SetResourceEncapsulator (SCR_ResourceEncapsulator encapsulator)
 
bool IncreaseResourceValue (float value, bool notifyChange=true)
 
bool DecreaseResourceValue (float value, bool notifyChange=true)
 
bool MaxOutResourceValue (bool notifyChange=true)
 
bool DepleteResourceValue (bool notifyChange=true)
 
void SetOnEmptyBehavior (EResourceContainerOnEmptyBehavior behavior)
 
bool LinkInteractor (notnull SCR_ResourceInteractor interactor)
 
bool UnlinkInteractor (notnull SCR_ResourceInteractor interactor)
 
void UnlinkEveryInteractor ()
 
bool EnableGain (bool shouldEnable, bool notifyChange=true)
 
bool EnableDecay (bool shouldEnable, bool notifyChange=true)
 
void SetIsEncapsulated (bool shouldEnable)
 
void UpdateWeightMultiplier ()
 
void DebugDraw (bool shouldShowRange=true)
 
override void Update (WorldTimestamp timestamp)
 Method used to perform a periodic/iterative update on the state of the resource actor.
 
float ComputeResourceDifference ()
 
void CopyFromContainer (notnull SCR_ResourceContainer container)
 
void Initialize (notnull IEntity owner, notnull SCR_ResourceContainer container)
 
override void Clear ()
 
- Public Member Functions inherited from SCR_ResourceActor
Color GetDebugColor ()
 
int GetGridUpdateId ()
 
vector GetOwnerOrigin ()
 
string GetDebugName ()
 
int GetDebugNameHash ()
 
SCR_ResourceComponent GetComponent ()
 
IEntity GetOwner ()
 
EResourceRights GetResourceRight ()
 
bool IsGridUpdateIdGreaterThan (int gridUpdateId)
 
void SetResourceRights (EResourceRights rights)
 
void SetGridUpdateId (int gridUpdateId)
 
void Update (float timeslice)
 Method used to perform a periodic/iterative update on the state of the resource actor.
 
void UpdateInner (float timeslice)
 
void ~SCR_ResourceActor ()
 

Public Attributes

float debugControlOffset = 0.25
 
- Public Attributes inherited from SCR_ResourceActor
string m_sDebugName
 

Protected Member Functions

void ComputeResourceGain (float timeslice, out float resourceValue)
 
void ComputeResourceDecay (float timeslice, out float resourceValue)
 
void OnResourcesChanged (float previousValue)
 
void OnResourcesIncreased (float previousValue)
 
void OnResourcesDecreased (float previousValue)
 
void OnResourcesDepleted (float previousValue)
 
void OnResourcesMaxedOut (float previousValue)
 
void OnMaxResourcesChanged (float previousValue)
 
void OnGainChanged (float previousValue)
 
void OnDecayChanged (float previousValue)
 
void OnGainEnabledChanged (float previousValue)
 
void OnDecayEnabledChanged (float previousValue)
 

Protected Attributes

ref set< SCR_ResourceInteractorm_aInteractors = new set<SCR_ResourceInteractor>()
 
EResourceContainerStorageType m_eStorageType
 
float m_fResourceValueCurrent
 
float m_fResourceValueMax
 
bool m_bEnableResourceGain
 
float m_fResourceGain
 
float m_fResourceGainTickrate
 
float m_fResourceGainTimeout
 
bool m_bEnableResourceDecay
 
float m_fResourceDecay
 
float m_fResourceDecayTickrate
 
float m_fResourceDecayTimeout
 
EResourceContainerOnEmptyBehavior m_eOnEmptyBehavior
 
bool m_bIsEncapsulated
 
WorldTimestamp m_LastUpdateTimestamp
 
float m_fResourceGainElapsedTime
 
float m_fResourceDecayElapsedTime
 
float m_fWeightMultiplier
 
ref ScriptInvoker m_OnResourcesChangedInvoker
 
ref ScriptInvoker m_OnMaxResourcesChangedInvoker
 
ref ScriptInvoker m_OnResourcesDepletedInvoker
 
ref ScriptInvoker m_OnResourcesMaxedOutInvoker
 
ref ScriptInvoker m_OnGainChangedInvoker
 
ref ScriptInvoker m_OnDecayChangedInvoker
 
ref ScriptInvoker m_OnGainEnabledChangedInvoker
 
ref ScriptInvoker m_OnDecayEnabledChangedInvoker
 
SCR_ResourceEncapsulator m_ResourceEncapsulator
 
- Protected Attributes inherited from SCR_ResourceActor
EResourceRights m_eResourceRights
 
EResourceType m_eResourceType
 
SCR_ResourceComponent m_ResourceComponent
 
IEntity m_Owner
 

Additional Inherited Members

- Static Public Attributes inherited from SCR_ResourceActor
static const float RESOURCES_LOWER_LIMIT = 0.0
 
- Static Protected Attributes inherited from SCR_ResourceActor
static const float UPDATE_PERIOD = 10.0 / 60.0
 
static const int CODEC_GENERATOR_PACKET_BYTESIZE = 32
 

Member Function Documentation

◆ CanStoreResource()

bool SCR_ResourceContainer.CanStoreResource ( )

◆ Clear()

override void SCR_ResourceContainer.Clear ( )

Implements SCR_ResourceActor.

◆ ComputeResourceDecay()

void SCR_ResourceContainer.ComputeResourceDecay ( float timeslice,
out float resourceValue )
protected

◆ ComputeResourceDifference()

float SCR_ResourceContainer.ComputeResourceDifference ( )

◆ ComputeResourceGain()

void SCR_ResourceContainer.ComputeResourceGain ( float timeslice,
out float resourceValue )
protected

◆ CopyFromContainer()

void SCR_ResourceContainer.CopyFromContainer ( notnull SCR_ResourceContainer container)

◆ DebugDraw()

void SCR_ResourceContainer.DebugDraw ( bool shouldShowRange = true)

◆ DecreaseResourceValue()

bool SCR_ResourceContainer.DecreaseResourceValue ( float value,
bool notifyChange = true )

◆ DepleteResourceValue()

bool SCR_ResourceContainer.DepleteResourceValue ( bool notifyChange = true)

◆ EnableDecay()

bool SCR_ResourceContainer.EnableDecay ( bool shouldEnable,
bool notifyChange = true )

◆ EnableGain()

bool SCR_ResourceContainer.EnableGain ( bool shouldEnable,
bool notifyChange = true )

◆ GetAxisAlignedBoundingVolume()

void SCR_ResourceContainer.GetAxisAlignedBoundingVolume ( inout vector mins,
inout vector maxs )

◆ GetBoundingVolume()

void SCR_ResourceContainer.GetBoundingVolume ( inout vector mins,
inout vector maxs )

◆ GetLastUpdateTimestamp()

WorldTimestamp SCR_ResourceContainer.GetLastUpdateTimestamp ( )

Returns the timestamp that is aimed to be used for the computation of gain and decay.

◆ GetLinkedInteractorAt()

SCR_ResourceInteractor SCR_ResourceContainer.GetLinkedInteractorAt ( int index)

◆ GetLinkedInteractorIndex()

int SCR_ResourceContainer.GetLinkedInteractorIndex ( notnull SCR_ResourceInteractor interactor)

◆ GetLinkedInteractors()

set< SCR_ResourceInteractor > SCR_ResourceContainer.GetLinkedInteractors ( )

◆ GetLinkedInteractorsCopy()

array< SCR_ResourceInteractor > SCR_ResourceContainer.GetLinkedInteractorsCopy ( )

◆ GetLinkedInteractorsCount()

int SCR_ResourceContainer.GetLinkedInteractorsCount ( )

◆ GetMaxResourceValue()

float SCR_ResourceContainer.GetMaxResourceValue ( )

◆ GetOnDecayChanged()

ScriptInvoker SCR_ResourceContainer.GetOnDecayChanged ( )

◆ GetOnDecayEnabledChanged()

ScriptInvoker SCR_ResourceContainer.GetOnDecayEnabledChanged ( )

◆ GetOnEmptyBehavior()

EResourceContainerOnEmptyBehavior SCR_ResourceContainer.GetOnEmptyBehavior ( )

◆ GetOnGainChanged()

ScriptInvoker SCR_ResourceContainer.GetOnGainChanged ( )

◆ GetOnGainEnabledChanged()

ScriptInvoker SCR_ResourceContainer.GetOnGainEnabledChanged ( )

◆ GetOnMaxResourcesChanged()

ScriptInvoker SCR_ResourceContainer.GetOnMaxResourcesChanged ( )

◆ GetOnResourcesChanged()

ScriptInvoker SCR_ResourceContainer.GetOnResourcesChanged ( )

◆ GetOnResourcesDepleted()

ScriptInvoker SCR_ResourceContainer.GetOnResourcesDepleted ( )

◆ GetOnResourcesMaxedOut()

ScriptInvoker SCR_ResourceContainer.GetOnResourcesMaxedOut ( )

◆ GetResourceDecay()

float SCR_ResourceContainer.GetResourceDecay ( )

◆ GetResourceDecayTickrate()

float SCR_ResourceContainer.GetResourceDecayTickrate ( )

◆ GetResourceEncapsulator()

SCR_ResourceEncapsulator SCR_ResourceContainer.GetResourceEncapsulator ( )

◆ GetResourceGain()

float SCR_ResourceContainer.GetResourceGain ( )

◆ GetResourceGainTickrate()

float SCR_ResourceContainer.GetResourceGainTickrate ( )

◆ GetResourceType()

EResourceType SCR_ResourceContainer.GetResourceType ( )

◆ GetResourceValue()

float SCR_ResourceContainer.GetResourceValue ( )

◆ GetStorageType()

EResourceContainerStorageType SCR_ResourceContainer.GetStorageType ( )

◆ GetWeightMultiplier()

float SCR_ResourceContainer.GetWeightMultiplier ( )

◆ IncreaseResourceValue()

bool SCR_ResourceContainer.IncreaseResourceValue ( float value,
bool notifyChange = true )

◆ Initialize()

void SCR_ResourceContainer.Initialize ( notnull IEntity owner,
notnull SCR_ResourceContainer container )

Finds the top most faction affiliation component of the parents, if any and also finds the first resource encapsulator from parent to parent that can register the container, then registers the container into that encapsulator.

◆ IsAllowed()

bool SCR_ResourceContainer.IsAllowed ( notnull SCR_ResourceInteractor interactor)

◆ IsAllowedToStoreResource()

bool SCR_ResourceContainer.IsAllowedToStoreResource ( )

◆ IsEncapsulated()

bool SCR_ResourceContainer.IsEncapsulated ( )

◆ IsInRange()

bool SCR_ResourceContainer.IsInRange ( vector origin,
float range )

◆ IsInteractorLinked()

bool SCR_ResourceContainer.IsInteractorLinked ( notnull SCR_ResourceInteractor interactor)

◆ IsIsolated()

override bool SCR_ResourceContainer.IsIsolated ( )
Returns

Implements SCR_ResourceActor.

◆ IsResourceDecayEnabled()

bool SCR_ResourceContainer.IsResourceDecayEnabled ( )

◆ IsResourceGainEnabled()

bool SCR_ResourceContainer.IsResourceGainEnabled ( )

◆ LinkInteractor()

bool SCR_ResourceContainer.LinkInteractor ( notnull SCR_ResourceInteractor interactor)

◆ MaxOutResourceValue()

bool SCR_ResourceContainer.MaxOutResourceValue ( bool notifyChange = true)

◆ OnDecayChanged()

void SCR_ResourceContainer.OnDecayChanged ( float previousValue)
protected

◆ OnDecayEnabledChanged()

void SCR_ResourceContainer.OnDecayEnabledChanged ( float previousValue)
protected

◆ OnGainChanged()

void SCR_ResourceContainer.OnGainChanged ( float previousValue)
protected

◆ OnGainEnabledChanged()

void SCR_ResourceContainer.OnGainEnabledChanged ( float previousValue)
protected

◆ OnMaxResourcesChanged()

void SCR_ResourceContainer.OnMaxResourcesChanged ( float previousValue)
protected

◆ OnResourcesChanged()

void SCR_ResourceContainer.OnResourcesChanged ( float previousValue)
protected

◆ OnResourcesDecreased()

void SCR_ResourceContainer.OnResourcesDecreased ( float previousValue)
protected

◆ OnResourcesDepleted()

void SCR_ResourceContainer.OnResourcesDepleted ( float previousValue)
protected

◆ OnResourcesIncreased()

void SCR_ResourceContainer.OnResourcesIncreased ( float previousValue)
protected

◆ OnResourcesMaxedOut()

void SCR_ResourceContainer.OnResourcesMaxedOut ( float previousValue)
protected

◆ SetIsEncapsulated()

void SCR_ResourceContainer.SetIsEncapsulated ( bool shouldEnable)

◆ SetLastUpdateTimestamp()

void SCR_ResourceContainer.SetLastUpdateTimestamp ( WorldTimestamp timestamp)

Sets the timestamp that is aimed to be used for the computation of gain and decay.

Parameters
[in]timestampthe timestamp to set as last update timestamp.

◆ SetMaxResourceValue()

bool SCR_ResourceContainer.SetMaxResourceValue ( float value,
bool notifyChange = true )

◆ SetOnEmptyBehavior()

void SCR_ResourceContainer.SetOnEmptyBehavior ( EResourceContainerOnEmptyBehavior behavior)

◆ SetResourceDecay()

bool SCR_ResourceContainer.SetResourceDecay ( float value,
bool notifyChange = true )

◆ SetResourceDecayTickrate()

void SCR_ResourceContainer.SetResourceDecayTickrate ( float tickrate)

◆ SetResourceDecayTimeout()

void SCR_ResourceContainer.SetResourceDecayTimeout ( float timeout)

◆ SetResourceEncapsulator()

void SCR_ResourceContainer.SetResourceEncapsulator ( SCR_ResourceEncapsulator encapsulator)

◆ SetResourceGain()

bool SCR_ResourceContainer.SetResourceGain ( float value,
bool notifyChange = true )

◆ SetResourceGainTickrate()

void SCR_ResourceContainer.SetResourceGainTickrate ( float tickrate)

◆ SetResourceGainTimeout()

void SCR_ResourceContainer.SetResourceGainTimeout ( float timeout)

◆ SetResourceValue()

bool SCR_ResourceContainer.SetResourceValue ( float value,
bool notifyChange = true )

Sets the resource value of the container to the specified value, clamped to the maximum resource value.

Parameters
[in]valueThe resource value to set the container to.
[in]notifyChangeWhenever or not changes in resource value should be notified for this instance.
Returns
true if any change in resource was actually performed, false otherwise.

◆ SetResourceValueUnsafe()

bool SCR_ResourceContainer.SetResourceValueUnsafe ( float value,
bool notifyChange = true )

Unsafely sets the resource value of the container to the specified value, clamped to the maximum resource value.

Warning
Use with care, changing the resource value with this method expects you to take care of all the other factors externally, such as updating resource encapsulators and alike.
Parameters
[in]valueThe resource value to set the container to.
[in]notifyChangeWhenever or not changes in resource value should be notified for this instance.
Returns
true if any change in resource value was actually performed, false otherwise.

◆ ShouldUpdate()

override bool SCR_ResourceContainer.ShouldUpdate ( )
Returns

Implements SCR_ResourceActor.

◆ UnlinkEveryInteractor()

void SCR_ResourceContainer.UnlinkEveryInteractor ( )

◆ UnlinkInteractor()

bool SCR_ResourceContainer.UnlinkInteractor ( notnull SCR_ResourceInteractor interactor)

◆ Update()

override void SCR_ResourceContainer.Update ( WorldTimestamp timestamp)

Method used to perform a periodic/iterative update on the state of the resource actor.

Parameters
[in]timestampWorldTimestamp object of the moment when the method was called.

Implements SCR_ResourceActor.

◆ UpdateWeightMultiplier()

void SCR_ResourceContainer.UpdateWeightMultiplier ( )

Member Data Documentation

◆ debugControlOffset

float SCR_ResourceContainer.debugControlOffset = 0.25

◆ m_aInteractors

ref set<SCR_ResourceInteractor> SCR_ResourceContainer.m_aInteractors = new set<SCR_ResourceInteractor>()
protected

◆ m_bEnableResourceDecay

bool SCR_ResourceContainer.m_bEnableResourceDecay
protected

◆ m_bEnableResourceGain

bool SCR_ResourceContainer.m_bEnableResourceGain
protected

◆ m_bIsEncapsulated

bool SCR_ResourceContainer.m_bIsEncapsulated
protected

◆ m_eOnEmptyBehavior

EResourceContainerOnEmptyBehavior SCR_ResourceContainer.m_eOnEmptyBehavior
protected

◆ m_eStorageType

EResourceContainerStorageType SCR_ResourceContainer.m_eStorageType
protected

◆ m_fResourceDecay

float SCR_ResourceContainer.m_fResourceDecay
protected

◆ m_fResourceDecayElapsedTime

float SCR_ResourceContainer.m_fResourceDecayElapsedTime
protected

◆ m_fResourceDecayTickrate

float SCR_ResourceContainer.m_fResourceDecayTickrate
protected

◆ m_fResourceDecayTimeout

float SCR_ResourceContainer.m_fResourceDecayTimeout
protected

◆ m_fResourceGain

float SCR_ResourceContainer.m_fResourceGain
protected

◆ m_fResourceGainElapsedTime

float SCR_ResourceContainer.m_fResourceGainElapsedTime
protected

◆ m_fResourceGainTickrate

float SCR_ResourceContainer.m_fResourceGainTickrate
protected

◆ m_fResourceGainTimeout

float SCR_ResourceContainer.m_fResourceGainTimeout
protected

◆ m_fResourceValueCurrent

float SCR_ResourceContainer.m_fResourceValueCurrent
protected

◆ m_fResourceValueMax

float SCR_ResourceContainer.m_fResourceValueMax
protected

◆ m_fWeightMultiplier

float SCR_ResourceContainer.m_fWeightMultiplier
protected

◆ m_LastUpdateTimestamp

WorldTimestamp SCR_ResourceContainer.m_LastUpdateTimestamp
protected

◆ m_OnDecayChangedInvoker

ref ScriptInvoker SCR_ResourceContainer.m_OnDecayChangedInvoker
protected

◆ m_OnDecayEnabledChangedInvoker

ref ScriptInvoker SCR_ResourceContainer.m_OnDecayEnabledChangedInvoker
protected

◆ m_OnGainChangedInvoker

ref ScriptInvoker SCR_ResourceContainer.m_OnGainChangedInvoker
protected

◆ m_OnGainEnabledChangedInvoker

ref ScriptInvoker SCR_ResourceContainer.m_OnGainEnabledChangedInvoker
protected

◆ m_OnMaxResourcesChangedInvoker

ref ScriptInvoker SCR_ResourceContainer.m_OnMaxResourcesChangedInvoker
protected

◆ m_OnResourcesChangedInvoker

ref ScriptInvoker SCR_ResourceContainer.m_OnResourcesChangedInvoker
protected

◆ m_OnResourcesDepletedInvoker

ref ScriptInvoker SCR_ResourceContainer.m_OnResourcesDepletedInvoker
protected

◆ m_OnResourcesMaxedOutInvoker

ref ScriptInvoker SCR_ResourceContainer.m_OnResourcesMaxedOutInvoker
protected

◆ m_ResourceEncapsulator

SCR_ResourceEncapsulator SCR_ResourceContainer.m_ResourceEncapsulator
protected

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