Arma Reforger Script API
|
Static Public Member Functions | |
static bool | IsGlobalResourceTypeEnabled (EResourceType resourceType=EResourceType.SUPPLIES) |
static bool | GetStoredResources (notnull SCR_ResourceComponent resourceComponent, out float storedRescources, EResourceType resourceType=EResourceType.SUPPLIES) |
Get the amount of resources stored in the resource component. | |
static EResourceReason | ConsumeResources (notnull SCR_ResourceComponent resourceComponent, float resourcesToConsume, bool failIfNotEnoughResources, EResourceType resourceType=EResourceType.SUPPLIES) |
Call this to consume resources. | |
static string | SuppliesToString (float supplies) |
Function to unify the way supplies are displayed in UI. | |
static bool | GetStoredAndMaxResources (notnull SCR_ResourceComponent resourceComponent, out float totalResources, out float maxResources, EResourceType resourceType=EResourceType.SUPPLIES) |
Get the amount of resources stored as well as the max amount that can be stored in the resource component. | |
static bool | GetAvailableResources (notnull SCR_ResourceComponent resourceComponent, out float availableResources, EResourceGeneratorID resourceID=EResourceGeneratorID.DEFAULT, EResourceType resourceType=EResourceType.SUPPLIES) |
Get the amount of resources that are available to use for the given resource component. | |
static SCR_ResourceConsumer | GetStorageConsumer (notnull SCR_ResourceComponent resourceComponent, EResourceType resourceType=EResourceType.SUPPLIES) |
Get the storage consumer from the given ResourceCompoment. | |
static SCR_ResourceConsumer | GetAvailableResourceConsumer (notnull SCR_ResourceComponent resourceComponent, EResourceType resourceType=EResourceType.SUPPLIES) |
Get the consumer for that will grant you access to the available resources. | |
static SCR_ResourceConsumer | GetFirstValidConsumer (notnull SCR_ResourceComponent resourceComponent, EResourceType resourceType=EResourceType.SUPPLIES) |
Get the first valid consumer that could be found. | |
static SCR_ResourceGenerator | GetFirstValidGenerator (notnull SCR_ResourceComponent resourceComponent, EResourceType resourceType=EResourceType.SUPPLIES) |
Get the first valid generator that could be found. | |
static float | RoundRefundSupplyAmount (float refundCost) |
Static function to make sure that all refunds are treated the same way return Correctly rounded refund amount. | |
Static Public Attributes | |
static const int | DECIMALS_SUPPLIES = 1 |
|
static |
Call this to consume resources.
resourceComponent | ResourceComponent to get consume resources from |
resourcesToConsume | How much needs to be consumed |
failIfNotEnoughResources | If true it will never remove resources if there aren't enough. If false it will remove either the given amount or, if not enough resources, it will remove all the resources it can |
resourceType | Type of resources to find |
|
static |
Get the consumer for that will grant you access to the available resources.
resourceComponent | ResourceComponent to get consumer from |
resourceType | Type of resources the consumer has |
|
static |
Get the amount of resources that are available to use for the given resource component.
resourceComponent | ResourceComponent to get available resources from | |
[out] | availableResources | How many resources are available |
resourceID | Type of resources it checks. By default this is DEFAULT | |
resourceType | Type of resources to find |
|
static |
Get the first valid consumer that could be found.
resourceComponent | ResourceComponent to get consumer from |
resourceType | Type of resources the consumer has |
|
static |
Get the first valid generator that could be found.
resourceComponent | ResourceComponent to get generator from |
resourceType | Type of resources the generator has |
|
static |
Get the storage consumer from the given ResourceCompoment.
resourceComponent | ResourceComponent to get consumer from |
resourceType | Type of resources the consumer has |
|
static |
Get the amount of resources stored as well as the max amount that can be stored in the resource component.
resourceComponent | ResourceComponent to get stored resources from | |
[out] | Current | stored resources (0 if no valid resources are found) |
[out] | Max | stored resources (0 if no valid resources are found) |
resourceType | Type of resources to find |
|
static |
Get the amount of resources stored in the resource component.
resourceComponent | ResourceComponent to get stored resources from | |
[out] | storedRescources | How many resources were found |
resourceType | Type of resources to find |
|
static |
[in] | resourceType | Resource type |
|
static |
Static function to make sure that all refunds are treated the same way return Correctly rounded refund amount.
|
static |
Function to unify the way supplies are displayed in UI.
supplies | Supplies float to be converted to string |
|
static |