Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
SCR_ResourceContainerQueueBase Interface Reference
Inheritance diagram for SCR_ResourceContainerQueueBase:
[legend]

Public Member Functions

float GetAggregatedResourceValue ()
 Returns the current value of the aggregated resources pre-calculated by adding the current resource values of the containers registered into the container queue.
 
float GetAggregatedMaxResourceValue ()
 Returns the current maximum value of the aggregated resources pre-calculated by adding the maximum resource values of the containers registered into the container queue.
 
SCR_ResourceContainer GetFirstContainer ()
 Returns the first resource container in the queue.
 
SCR_ResourceContainer GetContainerAt (int index)
 Returns a resource container located at the provided index/position in the queue.
 
int GetContainerCount ()
 Returns the number of registered containers in the queue.
 
int RegisterContainer (notnull SCR_ResourceContainer container)
 Registers a container into the queue.
 
int FindContainer (notnull SCR_ResourceContainer container)
 Finds the position of a specified container in the queue and returns said position.
 
SCR_ResourceContainer PopFirstContainer ()
 Removes from the queue the first container and returns it.
 
SCR_ResourceContainer PopContainerAt (int index)
 Removes from the queue the container at the specified index/position and returns it.
 
void SetAggregatedResourceValue (float value)
 Assigns the current value of the aggregated resources to a specific value.
 
void SetAggregatedMaxResourceValue (float value)
 Assigns the current maximum value of the aggregated resources to a specific value.
 
void IncreaseAggregatedResourceValue (float increment)
 Increases the current value of the aggregated resources with a specific increment.
 
void DecreaseAggregatedResourceValue (float decrement)
 Decreases the current value of the aggregated resources with a specific decrement.
 
void IncreaseAggregatedMaxResourceValue (float increment)
 Increases the current maximum value of the aggregated resources with a specific increment.
 
void DecreaseAggregatedMaxResourceValue (float decrement)
 Decreases the current maximum value of the aggregated resources with a specific decrement.
 
array< SCR_ResourceContainerClear ()
 Clears and resets the queue.
 
void PerformSorting ()
 
void Initialize (notnull SCR_ResourceInteractor interactor)
 
void DebugDraw ()
 
float UpdateContainerResourceValue (float currentValue, float previousValue)
 
float UpdateContainerMaxResourceValue (float currentValue, float previousValue)
 
void SCR_ResourceContainerQueueBase ()
 Constructor.
 
void ~SCR_ResourceContainerQueueBase ()
 Destructor.
 

Static Public Attributes

static const int FIRST_CONTAINER_INDEX = 0
 
static const int INVALID_CONTAINER_INDEX = -1
 
static const int INVALID_CONTAINER_COUNT = -1
 

Protected Attributes

SCR_ResourceComponent m_ResourceComponent
 
ref array< SCR_ResourceContainerm_aRegisteredContainers = new array<SCR_ResourceContainer>()
 
float m_fAggregatedResourceValue
 
float m_fAggregatedMaxResourceValue
 

Constructor & Destructor Documentation

◆ SCR_ResourceContainerQueueBase()

void SCR_ResourceContainerQueueBase.SCR_ResourceContainerQueueBase ( )

Constructor.

◆ ~SCR_ResourceContainerQueueBase()

void SCR_ResourceContainerQueueBase.~SCR_ResourceContainerQueueBase ( )

Destructor.

Member Function Documentation

◆ Clear()

array< SCR_ResourceContainer > SCR_ResourceContainerQueueBase.Clear ( )

Clears and resets the queue.

TODO: Optimize this.

Implemented in SCR_ResourceContainerQueue< Class ResourceInteractorType >.

◆ DebugDraw()

void SCR_ResourceContainerQueueBase.DebugDraw ( )

◆ DecreaseAggregatedMaxResourceValue()

void SCR_ResourceContainerQueueBase.DecreaseAggregatedMaxResourceValue ( float  decrement)

Decreases the current maximum value of the aggregated resources with a specific decrement.

Warning
Use with care, decreasing to an arbitrary decrement with this could destabilize the entire queue maximum aggregated resource value processing.
Parameters
decrementThe desired value to be decremented on the current maximum value of the aggregated resources.

◆ DecreaseAggregatedResourceValue()

void SCR_ResourceContainerQueueBase.DecreaseAggregatedResourceValue ( float  decrement)

Decreases the current value of the aggregated resources with a specific decrement.

Warning
Use with care, decreasing to an arbitrary decrement with this could destabilize the entire queue aggregated resource value processing.
Parameters
decrementThe desired value to be decremented on the current value of the aggregated resources.

◆ FindContainer()

int SCR_ResourceContainerQueueBase.FindContainer ( notnull SCR_ResourceContainer  container)

Finds the position of a specified container in the queue and returns said position.

Parameters
containerThe container to ne found in the queue.
Returns
The position of the container in the queue or a representation of a invalid index in the queue in case of failure.

◆ GetAggregatedMaxResourceValue()

float SCR_ResourceContainerQueueBase.GetAggregatedMaxResourceValue ( )

Returns the current maximum value of the aggregated resources pre-calculated by adding the maximum resource values of the containers registered into the container queue.

Returns
The current maximum value of aggregated resources.

◆ GetAggregatedResourceValue()

float SCR_ResourceContainerQueueBase.GetAggregatedResourceValue ( )

Returns the current value of the aggregated resources pre-calculated by adding the current resource values of the containers registered into the container queue.

Returns
The current value of aggregated resources.

◆ GetContainerAt()

SCR_ResourceContainer SCR_ResourceContainerQueueBase.GetContainerAt ( int  index)

Returns a resource container located at the provided index/position in the queue.

Warning
Note that this method should only be called if and only if the queue has an element at the desired index.
Parameters
indexIndex/position of the desired container in the queue,
Returns
A resource container located at the provided index/position in the queue.

◆ GetContainerCount()

int SCR_ResourceContainerQueueBase.GetContainerCount ( )

Returns the number of registered containers in the queue.

Returns
The number of registered containers in the queue.

◆ GetFirstContainer()

SCR_ResourceContainer SCR_ResourceContainerQueueBase.GetFirstContainer ( )

Returns the first resource container in the queue.

Warning
Note that it is the first one in the queue in terms of order/priority and not the first container to be registered so do not cache this value as a pointer to the first container. Note that this method should only be called if and only if the queue is not empty.
Returns
The first resource container in the queue.

◆ IncreaseAggregatedMaxResourceValue()

void SCR_ResourceContainerQueueBase.IncreaseAggregatedMaxResourceValue ( float  increment)

Increases the current maximum value of the aggregated resources with a specific increment.

Warning
Use with care, increasing to an arbitrary increment with this could destabilize the entire queue maximum aggregated resource value processing.
Parameters
incrementThe desired value to be incremented on the current maximum value of the aggregated resources.

◆ IncreaseAggregatedResourceValue()

void SCR_ResourceContainerQueueBase.IncreaseAggregatedResourceValue ( float  increment)

Increases the current value of the aggregated resources with a specific increment.

Warning
Use with care, increasing to an arbitrary increment with this could destabilize the entire queue aggregated resource value processing.
Parameters
incrementThe desired value to be incremented on the current value of the aggregated resources.

◆ Initialize()

void SCR_ResourceContainerQueueBase.Initialize ( notnull SCR_ResourceInteractor  interactor)

◆ PerformSorting()

void SCR_ResourceContainerQueueBase.PerformSorting ( )

◆ PopContainerAt()

SCR_ResourceContainer SCR_ResourceContainerQueueBase.PopContainerAt ( int  index)

Removes from the queue the container at the specified index/position and returns it.

Warning
Note that this method should only be called if and only if the queue has an element at the desired index.
Parameters
indexIndex/position of the desired container in the queue,
Returns
A resource container that was located at the provided index/position in the queue.

Implemented in SCR_ResourceContainerQueue< Class ResourceInteractorType >.

◆ PopFirstContainer()

SCR_ResourceContainer SCR_ResourceContainerQueueBase.PopFirstContainer ( )

Removes from the queue the first container and returns it.

Warning
Note that this method should only be called if and only if the queue is not empty.
Returns
The container that was at the first position in the queue.

Implemented in SCR_ResourceContainerQueue< Class ResourceInteractorType >.

◆ RegisterContainer()

int SCR_ResourceContainerQueueBase.RegisterContainer ( notnull SCR_ResourceContainer  container)

Registers a container into the queue.

Warning
An existence check is not performed so the method should not be called if the container is already registered in the queue.
Parameters
containerThe container to be registered into the queue.
Returns
The position of the container in the queue.

Implemented in SCR_ResourceContainerQueue< Class ResourceInteractorType >.

◆ SetAggregatedMaxResourceValue()

void SCR_ResourceContainerQueueBase.SetAggregatedMaxResourceValue ( float  value)

Assigns the current maximum value of the aggregated resources to a specific value.

Warning
Use with care, assigning an arbitrary value with this could destabilize the entire queue maximum aggregated resource value processing.
Parameters
valueThe desired value to be assigned for the current maximum value of the aggregated resources.

◆ SetAggregatedResourceValue()

void SCR_ResourceContainerQueueBase.SetAggregatedResourceValue ( float  value)

Assigns the current value of the aggregated resources to a specific value.

Warning
Use with care, assigning an arbitrary value with this could destabilize the entire queue aggregated resource value processing.
Parameters
valueThe desired value to be assigned for the current value of the aggregated resources.

◆ UpdateContainerMaxResourceValue()

float SCR_ResourceContainerQueueBase.UpdateContainerMaxResourceValue ( float  currentValue,
float  previousValue 
)

◆ UpdateContainerResourceValue()

float SCR_ResourceContainerQueueBase.UpdateContainerResourceValue ( float  currentValue,
float  previousValue 
)

Member Data Documentation

◆ FIRST_CONTAINER_INDEX

const int SCR_ResourceContainerQueueBase.FIRST_CONTAINER_INDEX = 0
static

◆ INVALID_CONTAINER_COUNT

const int SCR_ResourceContainerQueueBase.INVALID_CONTAINER_COUNT = -1
static

◆ INVALID_CONTAINER_INDEX

const int SCR_ResourceContainerQueueBase.INVALID_CONTAINER_INDEX = -1
static

◆ m_aRegisteredContainers

ref array<SCR_ResourceContainer> SCR_ResourceContainerQueueBase.m_aRegisteredContainers = new array<SCR_ResourceContainer>()
protected

◆ m_fAggregatedMaxResourceValue

float SCR_ResourceContainerQueueBase.m_fAggregatedMaxResourceValue
protected

◆ m_fAggregatedResourceValue

float SCR_ResourceContainerQueueBase.m_fAggregatedResourceValue
protected

◆ m_ResourceComponent

SCR_ResourceComponent SCR_ResourceContainerQueueBase.m_ResourceComponent
protected

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