GSCargoMonitor Class Reference

Class that handles all cargo movement monitoring related functions. More...


Static Public Member Functions

static int32 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.
static int32 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.
static int32 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.
static int32 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.
static void StopAllMonitoring ()
 Stop monitoring everything.


Detailed Description

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:

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.


Member Function Documentation

static int32 GSCargoMonitor::GetTownDeliveryAmount ( GSCompany::CompanyID  company,
CargoID  cargo,
TownID  town_id,
bool  keep_monitoring 
) [static]

Get the amount of cargo delivered to a town by a company since the last query, and update the monitoring state.

Parameters:
company Company to query.
cargo Cargo type to query.
town_id Town to query.
keep_monitoring If true, the given combination continues to be monitored for the next call. If false, monitoring ends.
Returns:
Amount of delivered cargo of the given cargo type to the given town by the given company since the last call, or -1 if a parameter is out-of-bound.

static int32 GSCargoMonitor::GetIndustryDeliveryAmount ( GSCompany::CompanyID  company,
CargoID  cargo,
IndustryID  industry_id,
bool  keep_monitoring 
) [static]

Get the amount of cargo delivered to an industry by a company since the last query, and update the monitoring state.

Parameters:
company Company to query.
cargo Cargo type to query.
industry_id Industry to query.
keep_monitoring If true, the given combination continues to be monitored for the next call. If false, monitoring ends.
Returns:
Amount of delivered cargo of the given cargo type to the given industry by the given company since the last call, or -1 if a parameter is out-of-bound.

static int32 GSCargoMonitor::GetTownPickupAmount ( GSCompany::CompanyID  company,
CargoID  cargo,
TownID  town_id,
bool  keep_monitoring 
) [static]

Get the amount of cargo picked up (and delivered) from a town by a company since the last query, and update the monitoring state.

Parameters:
company Company to query.
cargo Cargo type to query.
town_id Town to query.
keep_monitoring If true, the given combination continues to be monitored for the next call. If false, monitoring ends.
Returns:
Amount of picked up cargo of the given cargo type to the given town by the given company since the last call, or -1 if a parameter is out-of-bound.
Note:
Amounts of picked-up cargo are added during final delivery of it, to prevent users from getting credit for picking up without delivering it.

static int32 GSCargoMonitor::GetIndustryPickupAmount ( GSCompany::CompanyID  company,
CargoID  cargo,
IndustryID  industry_id,
bool  keep_monitoring 
) [static]

Get the amount of cargo picked up (and delivered) from an industry by a company since the last query, and update the monitoring state.

Parameters:
company Company to query.
cargo Cargo type to query.
industry_id Industry to query.
keep_monitoring If true, the given combination continues to be monitored for the next call. If false, monitoring ends.
Returns:
Amount of picked up cargo of the given cargo type to the given industry by the given company since the last call, or -1 if a parameter is out-of-bound.
Note:
Amounts of picked-up cargo are added during final delivery of it, to prevent users from getting credit for picking up without delivering it.

static void GSCargoMonitor::StopAllMonitoring (  )  [static]

Stop monitoring everything.


Generated on Sat Apr 1 17:11:59 2017 for OpenTTD Game API by  doxygen 1.5.6