|
static int | GetTownDeliveryAmount (GSCompany::CompanyID company, CargoID cargo, TownID town_id, bool keep_monitoring) |
| Get the amount of cargo delivered to a town by a company since the last query, and update the monitoring state. More...
|
|
static int | GetIndustryDeliveryAmount (GSCompany::CompanyID company, CargoID cargo, IndustryID industry_id, bool keep_monitoring) |
| Get the amount of cargo delivered to an industry by a company since the last query, and update the monitoring state. More...
|
|
static int | GetTownPickupAmount (GSCompany::CompanyID company, CargoID cargo, TownID town_id, bool keep_monitoring) |
| Get the amount of cargo picked up (and delivered) from a town by a company since the last query, and update the monitoring state. More...
|
|
static int | GetIndustryPickupAmount (GSCompany::CompanyID company, CargoID cargo, IndustryID industry_id, bool keep_monitoring) |
| Get the amount of cargo picked up (and delivered) from an industry by a company since the last query, and update the monitoring state. More...
|
|
static void | StopAllMonitoring () |
| Stop monitoring everything.
|
|
Class that handles all cargo movement monitoring related functions.
To get an understanding of what users are transporting, this class provides cargo pick-up and delivery monitoring functions. It works as follows:
- Select a company, a cargo-type, and an industry that gets the cargo triplet.
- Perform a call to GetIndustryDeliveryAmount, setting 'keep_monitoring' to
true
. The return value is not important, but from this moment the program accumulates all deliveries by the given company to the given industry of the given cargo type.
- Some time later, perform another call to GetIndustryDeliveryAmount. It returns the accumulated amount of cargo that the company has delivered. The call causes the collected amount to be reset. On the next call you will thus always get the delivered amount since the previous call.
- When monitoring the deliveries is not interesting any more, set 'keep_monitoring' to
false
. The collecting process that happens between calls is stopped.
In the same way you can monitor town deliveries, and you can monitor pick-up from towns and industries. The latter get added at the moment the cargo is delivered. This prevents users from getting credit for picking up cargo without delivering it.
The active monitors are saved and loaded. Upon bankruptcy or company takeover, the cargo monitors are automatically stopped for that company. You can reset to the empty state with StopAllMonitoring.