Simulator::cBundleManager class

Base classes

class cStrategy

Public static functions

static auto Get() -> cBundleManager*

Public functions

auto CreateBundles(float amount, cGameBundleContainer* container, int bundleType) -> cGameBundle*
Creates one or more bundles of the given type and adds them to the container.
auto RemoveBundles(float amount, cGameBundleContainer* container, cGameBundle* bundle = nullptr) -> float
Removes a certain quantity from a bundle container.

Public variables

void* mpGroundContainer

Function documentation

cGameBundle* Simulator::cBundleManager::CreateBundles(float amount, cGameBundleContainer* container, int bundleType)

Creates one or more bundles of the given type and adds them to the container.

Parameters
amount
container
bundleType
Returns The last bundle created

The number of bundles created depends on the 'amount' and how much value each bundle can contain, which depends on the container.

float Simulator::cBundleManager::RemoveBundles(float amount, cGameBundleContainer* container, cGameBundle* bundle = nullptr)

Removes a certain quantity from a bundle container.

Parameters
amount
container
bundle If not null, removes only that specific bundle
Returns The actual amount that has been removed.

This will remove as many bundles as necessary, and change the value of the last remaining bundle. If the amount is small enough, no bundle may be deleted.