Go to the source code of this file.
|
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) |
|
◆ 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.
◆ 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] | fuelTanksReceivers | optional if you want to only check specific fuel tanks. Leave null or empty to ignore |
[in] | ignoreIfHasFlags | ignore 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()
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 | ) |
|
◆ GetScriptedFuelNodesList() [2/2]
- Parameters
-
[out] | outScriptedNodes | |
[in] | hasFuelNodeFlags | |
[in] | ignoreIfHasFlags | |
[in] | queryType | |
- Returns
Definition at line 39 of file SCR_FuelManagerComponent.c.
◆ GetTotalValuesOfFuelNodes()
Get to currentFuel, totalfuel and fuel percentage of all nodes with the given flags
- Parameters
-
[out] | totalFuel | Total current fuel of all fuel nodes |
[out] | totalMaxFuel | Total max fuel of all fuel nodes |
[out] | totalFuelPercentage | Total fuel percentage of all fuel nodes. Gives value from 0 to 1 |
[in] | fuelNodeFlags | Only 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] | ignoreIfHasFlags | Any nodes with this flag is skipped. Leave 0 to ignore |
[in] | queryType | If 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] | ignoreIfHasFlags | any 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 | ) |
|
◆ SCR_FuelManagerComponent()
void SCR_FuelManagerComponent |
( |
IEntityComponentSource |
src, |
|
|
IEntity |
ent, |
|
|
IEntity |
parent |
|
) |
| |
◆ SetTotalFuelPercentage()
Set the total fuel percentage to a value between 0 and 1. (Server only) Distributes the fuel correctly between all fuel nodes
- Parameters
-
[in] | percentage | Percentage of fuel to set |
[in] | hasFuelNodeFlags | Flag 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] | ignoreIfHasFlags | Any nodes with this flag is skipped. Leave 0 to ignore |
[in] | queryType | If 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.
◆ m_OnFuelChanged