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

Public Member Functions

int GetGridUpdateId ()
 
int GetFrameBudget ()
 
void ResetFrameBudget ()
 
int ComputeIndex (int x, int z)
 
int ComputeIndex (int x, int y, int z)
 
int ComputeIndex (vector position)
 
int IncreaseGridUpdateId ()
 
void FlagResourceItem (notnull SCR_ResourceComponent item)
 
void UnflagResourceItem (notnull SCR_ResourceComponent item)
 
void ProcessFlaggedItems ()
 
void UpdateResourceStaticItem (notnull SCR_ResourceComponent item)
 
void UpdateResourceDynamicItem (notnull SCR_ResourceComponent item)
 
void PromoteResourceItemToDynamic (notnull SCR_ResourceComponent item)
 
void PromoteResourceItemToStatic (notnull SCR_ResourceComponent item)
 
void QueryContainers (vector boundsMins, vector boundsMaxs, EResourceType resourceType)
 
void QueryContainers (int mins, int maxs, EResourceType resourceType)
 
void QueryContainers (vector boundsMins, vector boundsMaxs, EResourceType resourceType, int gridUpdateId)
 
void QueryContainers (int mins, int maxs, EResourceType resourceType, int gridUpdateId)
 
void UpdateInteractor (notnull SCR_ResourceInteractor interactor, bool useFrameBudget=false)
 
array< SCR_ResourceGeneratorQueryGenerators (float range, vector origin)
 NOTE: Expensive, used only for specific cases and/or debugging.
 
array< SCR_ResourceGeneratorQueryGenerators (vector mins, vector maxs, vector transform[4])
 NOTE: Expensive, used only for specific cases and/or debugging.
 
bool ProcessResourceItem (notnull SCR_ResourceComponent item)
 
void UnregisterResourceItem (notnull SCR_ResourceComponent item)
 
void SCR_ResourceGrid ()
 
void ~SCR_ResourceGrid ()
 

Static Public Attributes

static const int MAX_FRAME_BUDGET = 20
 
static const int CELL_POWER = 4
 
static const int CELL_SIZE_MINUS_1 = (1 << CELL_POWER) - 1
 

Protected Member Functions

void QueryGridCells (int mins, int maxs, inout notnull array< SCR_ResourceGridCell > gridCells)
 

Protected Attributes

ref map< int, ref SCR_ResourceGridCellm_Cells
 
ref array< SCR_ResourceComponentm_aFlaggedItems = {}
 
ref set< SCR_ResourceContainerm_aQueriedContainers = new set<SCR_ResourceContainer>()
 
int m_iGridUpdateId = int.MIN
 
int m_iGridPerimeter
 
int m_iGridPerimeterMinusOne
 
int m_iFrameBudget
 

Constructor & Destructor Documentation

◆ SCR_ResourceGrid()

void SCR_ResourceGrid.SCR_ResourceGrid ( )

◆ ~SCR_ResourceGrid()

void SCR_ResourceGrid.~SCR_ResourceGrid ( )

Member Function Documentation

◆ ComputeIndex() [1/3]

int SCR_ResourceGrid.ComputeIndex ( int  x,
int  y,
int  z 
)

◆ ComputeIndex() [2/3]

int SCR_ResourceGrid.ComputeIndex ( int  x,
int  z 
)

◆ ComputeIndex() [3/3]

int SCR_ResourceGrid.ComputeIndex ( vector  position)

◆ FlagResourceItem()

void SCR_ResourceGrid.FlagResourceItem ( notnull SCR_ResourceComponent  item)

◆ GetFrameBudget()

int SCR_ResourceGrid.GetFrameBudget ( )

◆ GetGridUpdateId()

int SCR_ResourceGrid.GetGridUpdateId ( )

◆ IncreaseGridUpdateId()

int SCR_ResourceGrid.IncreaseGridUpdateId ( )

◆ ProcessFlaggedItems()

void SCR_ResourceGrid.ProcessFlaggedItems ( )

◆ ProcessResourceItem()

bool SCR_ResourceGrid.ProcessResourceItem ( notnull SCR_ResourceComponent  item)

TODO: Remove this hack.

◆ PromoteResourceItemToDynamic()

void SCR_ResourceGrid.PromoteResourceItemToDynamic ( notnull SCR_ResourceComponent  item)

◆ PromoteResourceItemToStatic()

void SCR_ResourceGrid.PromoteResourceItemToStatic ( notnull SCR_ResourceComponent  item)

◆ QueryContainers() [1/4]

void SCR_ResourceGrid.QueryContainers ( int  mins,
int  maxs,
EResourceType  resourceType 
)

Extract grid bounds's components from the previous grid bounds.

◆ QueryContainers() [2/4]

void SCR_ResourceGrid.QueryContainers ( int  mins,
int  maxs,
EResourceType  resourceType,
int  gridUpdateId 
)

Extract grid bounds's components from the previous grid bounds.

◆ QueryContainers() [3/4]

void SCR_ResourceGrid.QueryContainers ( vector  boundsMins,
vector  boundsMaxs,
EResourceType  resourceType 
)

Extract grid bounds's components from the previous grid bounds.

◆ QueryContainers() [4/4]

void SCR_ResourceGrid.QueryContainers ( vector  boundsMins,
vector  boundsMaxs,
EResourceType  resourceType,
int  gridUpdateId 
)

Extract grid bounds's components from the previous grid bounds.

◆ QueryGenerators() [1/2]

array< SCR_ResourceGenerator > SCR_ResourceGrid.QueryGenerators ( float  range,
vector  origin 
)

NOTE: Expensive, used only for specific cases and/or debugging.

◆ QueryGenerators() [2/2]

array< SCR_ResourceGenerator > SCR_ResourceGrid.QueryGenerators ( vector  mins,
vector  maxs,
vector  transform[4] 
)

NOTE: Expensive, used only for specific cases and/or debugging.

◆ QueryGridCells()

void SCR_ResourceGrid.QueryGridCells ( int  mins,
int  maxs,
inout notnull array< SCR_ResourceGridCell gridCells 
)
protected

Extract grid bounds's components from the previous grid bounds.

◆ ResetFrameBudget()

void SCR_ResourceGrid.ResetFrameBudget ( )

◆ UnflagResourceItem()

void SCR_ResourceGrid.UnflagResourceItem ( notnull SCR_ResourceComponent  item)

◆ UnregisterResourceItem()

void SCR_ResourceGrid.UnregisterResourceItem ( notnull SCR_ResourceComponent  item)

Get the previous grid bounds.

Cancel the operation if any of the previous grid bounds is invalid.

Extract grid bounds's items from the previous grid bounds.

Unregister item from every grid cell.

Set the item grid bounds to be invalid.

◆ UpdateInteractor()

void SCR_ResourceGrid.UpdateInteractor ( notnull SCR_ResourceInteractor  interactor,
bool  useFrameBudget = false 
)

◆ UpdateResourceDynamicItem()

void SCR_ResourceGrid.UpdateResourceDynamicItem ( notnull SCR_ResourceComponent  item)

Get the previous grid bounds.

Cancel the operation if any of the previous grid bounds is invalid.

Extract grid bounds's items from the previous grid bounds.

◆ UpdateResourceStaticItem()

void SCR_ResourceGrid.UpdateResourceStaticItem ( notnull SCR_ResourceComponent  item)

Get the previous grid bounds.

Cancel the operation if any of the previous grid bounds is invalid.

Extract grid bounds's items from the previous grid bounds.

Member Data Documentation

◆ CELL_POWER

const int SCR_ResourceGrid.CELL_POWER = 4
static

◆ CELL_SIZE_MINUS_1

const int SCR_ResourceGrid.CELL_SIZE_MINUS_1 = (1 << CELL_POWER) - 1
static

◆ m_aFlaggedItems

ref array<SCR_ResourceComponent> SCR_ResourceGrid.m_aFlaggedItems = {}
protected

◆ m_aQueriedContainers

ref set<SCR_ResourceContainer> SCR_ResourceGrid.m_aQueriedContainers = new set<SCR_ResourceContainer>()
protected

◆ m_Cells

ref map<int, ref SCR_ResourceGridCell> SCR_ResourceGrid.m_Cells
protected

◆ m_iFrameBudget

int SCR_ResourceGrid.m_iFrameBudget
protected

◆ m_iGridPerimeter

int SCR_ResourceGrid.m_iGridPerimeter
protected

◆ m_iGridPerimeterMinusOne

int SCR_ResourceGrid.m_iGridPerimeterMinusOne
protected

◆ m_iGridUpdateId

int SCR_ResourceGrid.m_iGridUpdateId = int.MIN
protected

◆ MAX_FRAME_BUDGET

const int SCR_ResourceGrid.MAX_FRAME_BUDGET = 20
static

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