Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_FuelManagerComponent.c File Reference

Go to the source code of this file.

Data Structures

class  SCR_FuelManagerComponentClass
 

Enumerations

enum  SCR_EFuelNodeFlagQueryType { EXACT_TYPE, ALL_GIVEN_TYPES, ANY_OF_GIVEN_TYPES }
 

Functions

int GetScriptedFuelNodesList (out notnull array< SCR_FuelNode > outScriptedNodes)
 
int GetScriptedFuelNodesList (out notnull array< SCR_FuelNode > outScriptedNodes, SCR_EFuelNodeTypeFlag hasFuelNodeFlags, SCR_EFuelNodeTypeFlag ignoreIfHasFlags=0, SCR_EFuelNodeFlagQueryType queryType=SCR_EFuelNodeFlagQueryType.ALL_GIVEN_TYPES)
 
bool CanBeRefueledScripted (array< int > fuelTanksReceivers=null, SCR_EFuelNodeTypeFlag ignoreIfHasFlags=0)
 
bool HasFuelToProvide (SCR_EFuelNodeTypeFlag ignoreIfHasFlags=0)
 
void GetTotalValuesOfFuelNodes (out float totalFuel, out float totalMaxFuel, out float totalFuelPercentage, SCR_EFuelNodeTypeFlag hasFuelNodeFlags=0, SCR_EFuelNodeTypeFlag ignoreIfHasFlags=0, SCR_EFuelNodeFlagQueryType queryType=SCR_EFuelNodeFlagQueryType.ALL_GIVEN_TYPES)
 
void SetTotalFuelPercentage (float percentage, SCR_EFuelNodeTypeFlag hasFuelNodeFlags=0, SCR_EFuelNodeTypeFlag ignoreIfHasFlags=0, SCR_EFuelNodeFlagQueryType queryType=SCR_EFuelNodeFlagQueryType.ALL_GIVEN_TYPES)
 
ScriptInvokerFloat GetOnFuelChanged ()
 
protected void OnFuelNodeAmountChanged (float newFuel)
 
void SCR_FuelManagerComponent (IEntityComponentSource src, IEntity ent, IEntity parent)
 

Variables

SCR_FuelManagerComponentClass m_OnFuelChanged
 

Enumeration Type Documentation

◆ SCR_EFuelNodeFlagQueryType

Enumerator
EXACT_TYPE 

Will only get fuel node if flag type is the same as given flag.

ALL_GIVEN_TYPES 

Will only get fuelnode if all the given types are present on the fuel node. (More than the given can be present but non can be missing)

ANY_OF_GIVEN_TYPES 

Will only get fuelnode if at least one of the given flags is present on the fuel node. (More than the given can be present)

Definition at line 498 of file SCR_FuelManagerComponent.c.

Function Documentation

◆ CanBeRefueledScripted()

bool CanBeRefueledScripted ( array< int fuelTanksReceivers = null,
SCR_EFuelNodeTypeFlag  ignoreIfHasFlags = 0 
)

Check if fuel manager can be refueled. Will only check fuel nodes with the CAN_RECEIVE_FUEL and without any of the given ignoreIfHasFlags

Parameters
[in]fuelTanksReceiversoptional if you want to only check specific fuel tanks. Leave null or empty to ignore
[in]ignoreIfHasFlagsignore any fuel nodes that have the ignore flags. Leave 0 to ignore
Returns
true if at least one fuel node can be refueled

Definition at line 98 of file SCR_FuelManagerComponent.c.

◆ GetOnFuelChanged()

ScriptInvokerFloat GetOnFuelChanged ( )

Return script invoker for on fuel changed. Note that this creates fuel invokers for all SCR_FuelNodes and there is no way currently to destroy them so can be costly

Returns
scriptInvoker on fuel changed. Includes current total fuel amount

Definition at line 446 of file SCR_FuelManagerComponent.c.

◆ GetScriptedFuelNodesList() [1/2]

int GetScriptedFuelNodesList ( out notnull array< SCR_FuelNode >  outScriptedNodes)
Parameters
[out]outScriptedNodes
Returns

Definition at line 13 of file SCR_FuelManagerComponent.c.

◆ GetScriptedFuelNodesList() [2/2]

int GetScriptedFuelNodesList ( out notnull array< SCR_FuelNode >  outScriptedNodes,
SCR_EFuelNodeTypeFlag  hasFuelNodeFlags,
SCR_EFuelNodeTypeFlag  ignoreIfHasFlags = 0,
SCR_EFuelNodeFlagQueryType  queryType = SCR_EFuelNodeFlagQueryType.ALL_GIVEN_TYPES 
)
Parameters
[out]outScriptedNodes
[in]hasFuelNodeFlags
[in]ignoreIfHasFlags
[in]queryType
Returns

Definition at line 39 of file SCR_FuelManagerComponent.c.

◆ GetTotalValuesOfFuelNodes()

void GetTotalValuesOfFuelNodes ( out float  totalFuel,
out float  totalMaxFuel,
out float  totalFuelPercentage,
SCR_EFuelNodeTypeFlag  hasFuelNodeFlags = 0,
SCR_EFuelNodeTypeFlag  ignoreIfHasFlags = 0,
SCR_EFuelNodeFlagQueryType  queryType = SCR_EFuelNodeFlagQueryType.ALL_GIVEN_TYPES 
)

Get to currentFuel, totalfuel and fuel percentage of all nodes with the given flags

Parameters
[out]totalFuelTotal current fuel of all fuel nodes
[out]totalMaxFuelTotal max fuel of all fuel nodes
[out]totalFuelPercentageTotal fuel percentage of all fuel nodes. Gives value from 0 to 1
[in]fuelNodeFlagsOnly checks fuel nodes with given type (or types depending if all or one flag is required). Leave 0 to get all node types even non SCR_FuelNodes. Otherwise only checks SCR_FuelNodes
[in]ignoreIfHasFlagsAny nodes with this flag is skipped. Leave 0 to ignore
[in]queryTypeIf the obtained data is from fuelnodes with: The exact given type, has all given flags, has at least one given flag

Definition at line 203 of file SCR_FuelManagerComponent.c.

◆ HasFuelToProvide()

bool HasFuelToProvide ( SCR_EFuelNodeTypeFlag  ignoreIfHasFlags = 0)

Check if fuelmanager has any fuel in fuel nodes that can provide fuel (SCR_FuelNode only)

Parameters
[in]ignoreIfHasFlagsany nodes with this flag is skipped. Leave 0 to ignore
Returns
true if it can provide fuel

Definition at line 173 of file SCR_FuelManagerComponent.c.

◆ OnFuelNodeAmountChanged()

protected void OnFuelNodeAmountChanged ( float  newFuel)

Definition at line 465 of file SCR_FuelManagerComponent.c.

◆ SCR_FuelManagerComponent()

void SCR_FuelManagerComponent ( IEntityComponentSource  src,
IEntity  ent,
IEntity  parent 
)
Parameters
[in]src
[in]ent
[in]parent

Definition at line 475 of file SCR_FuelManagerComponent.c.

◆ SetTotalFuelPercentage()

void SetTotalFuelPercentage ( float  percentage,
SCR_EFuelNodeTypeFlag  hasFuelNodeFlags = 0,
SCR_EFuelNodeTypeFlag  ignoreIfHasFlags = 0,
SCR_EFuelNodeFlagQueryType  queryType = SCR_EFuelNodeFlagQueryType.ALL_GIVEN_TYPES 
)

Set the total fuel percentage to a value between 0 and 1. (Server only) Distributes the fuel correctly between all fuel nodes

Parameters
[in]percentagePercentage of fuel to set
[in]hasFuelNodeFlagsFlag of what type (or types depending if all or one flag is required) of fuel nodes can be set. Leave 0 to set all node types. Non SCR_Nodes are always valid
[in]ignoreIfHasFlagsAny nodes with this flag is skipped. Leave 0 to ignore
[in]queryTypeIf the nodes that are set have: The exact given type, has all given flags, has at least one given flag

Definition at line 331 of file SCR_FuelManagerComponent.c.

Variable Documentation

◆ m_OnFuelChanged