|
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 EResourceReason | SimpleResourceTransfer (notnull SCR_ResourceComponent resourceComponentFrom, notnull SCR_ResourceComponent resourceComponentTo, float transferAmount, bool allowPartialTransfer=true, EResourceType resourceType=EResourceType.SUPPLIES) |
| Do simple transfer of resources between two components. | |
Static Public Attributes | |
| static const int | DECIMALS_SUPPLIES = 1 |
|
static |
Call this to consume resources.
| [in] | resourceComponent | ResourceComponent to get consume resources from |
| [in] | resourcesToConsume | How much needs to be consumed |
| [in] | 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 |
| [in] | resourceType | Type of resources to find |
|
static |
Get the consumer for that will grant you access to the available resources.
| [in] | resourceComponent | ResourceComponent to get consumer from |
| [in] | resourceType | Type of resources the consumer has |
|
static |
Get the amount of resources that are available to use for the given resource component.
| [in] | resourceComponent | ResourceComponent to get available resources from |
| [out] | availableResources | How many resources are available |
| [in] | resourceID | Type of resources it checks. By default this is DEFAULT |
| [in] | resourceType | Type of resources to find |
|
static |
Get the first valid consumer that could be found.
| [in] | resourceComponent | ResourceComponent to get consumer from |
| [in] | resourceType | Type of resources the consumer has |
|
static |
Get the first valid generator that could be found.
| [in] | resourceComponent | ResourceComponent to get generator from |
| [in] | resourceType | Type of resources the generator has |
|
static |
Get the storage consumer from the given ResourceCompoment.
| [in] | resourceComponent | ResourceComponent to get consumer from |
| [in] | 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.
| [in] | 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) |
| [in] | resourceType | Type of resources to find |
|
static |
Get the amount of resources stored in the resource component.
| [in] | resourceComponent | ResourceComponent to get stored resources from |
| [out] | storedRescources | How many resources were found |
| [in] | 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 |
Do simple transfer of resources between two components.
| [in] | resourceComponentFrom | ResourceComponent from where resources should be taken |
| [in] | resourceComponentTo | ResourceComponent to where resources should be transfered |
| [in] | transferAmount | Amound of resources to be transfered |
| [in] | allowPartialTransfer | Allow transfering only partial amount of desired resources, should there be less resources, or space in target ResourceComponent |
| [in] | resourceType | Type of resources to be transfered |
|
static |
Function to unify the way supplies are displayed in UI.
| [in] | supplies | Supplies float to be converted to string |
|
static |