Changeset - r26965:d5e8673b5872
[Not reviewed]
master
0 2 0
glx22 - 22 months ago 2023-02-10 00:18:00
glx@openttd.org
Codechange: Use SQInteger for generic numbers in script_cargomonitor
2 files changed with 8 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/script/api/script_cargomonitor.cpp
Show inline comments
 
@@ -15,7 +15,7 @@
 

	
 
#include "../../safeguards.h"
 

	
 
/* static */ int32 ScriptCargoMonitor::GetTownDeliveryAmount(ScriptCompany::CompanyID company, CargoID cargo, TownID town_id, bool keep_monitoring)
 
/* static */ SQInteger ScriptCargoMonitor::GetTownDeliveryAmount(ScriptCompany::CompanyID company, CargoID cargo, TownID town_id, bool keep_monitoring)
 
{
 
	CompanyID cid = static_cast<CompanyID>(company);
 
	if (cid >= MAX_COMPANIES) return -1;
 
@@ -26,7 +26,7 @@
 
	return GetDeliveryAmount(monitor, keep_monitoring);
 
}
 

	
 
/* static */ int32 ScriptCargoMonitor::GetIndustryDeliveryAmount(ScriptCompany::CompanyID company, CargoID cargo, IndustryID industry_id, bool keep_monitoring)
 
/* static */ SQInteger ScriptCargoMonitor::GetIndustryDeliveryAmount(ScriptCompany::CompanyID company, CargoID cargo, IndustryID industry_id, bool keep_monitoring)
 
{
 
	CompanyID cid = static_cast<CompanyID>(company);
 
	if (cid >= MAX_COMPANIES) return -1;
 
@@ -37,7 +37,7 @@
 
	return GetDeliveryAmount(monitor, keep_monitoring);
 
}
 

	
 
/* static */ int32 ScriptCargoMonitor::GetTownPickupAmount(ScriptCompany::CompanyID company, CargoID cargo, TownID town_id, bool keep_monitoring)
 
/* static */ SQInteger ScriptCargoMonitor::GetTownPickupAmount(ScriptCompany::CompanyID company, CargoID cargo, TownID town_id, bool keep_monitoring)
 
{
 
	CompanyID cid = static_cast<CompanyID>(company);
 
	if (cid >= MAX_COMPANIES) return -1;
 
@@ -48,7 +48,7 @@
 
	return GetPickupAmount(monitor, keep_monitoring);
 
}
 

	
 
/* static */ int32 ScriptCargoMonitor::GetIndustryPickupAmount(ScriptCompany::CompanyID company, CargoID cargo, IndustryID industry_id, bool keep_monitoring)
 
/* static */ SQInteger ScriptCargoMonitor::GetIndustryPickupAmount(ScriptCompany::CompanyID company, CargoID cargo, IndustryID industry_id, bool keep_monitoring)
 
{
 
	CompanyID cid = static_cast<CompanyID>(company);
 
	if (cid >= MAX_COMPANIES) return -1;
src/script/api/script_cargomonitor.hpp
Show inline comments
 
@@ -51,7 +51,7 @@ public:
 
	 * @return Amount of delivered cargo of the given cargo type to the given town by the given company since the last call, or
 
	 * \c -1 if a parameter is out-of-bound.
 
	 */
 
	static int32 GetTownDeliveryAmount(ScriptCompany::CompanyID company, CargoID cargo, TownID town_id, bool keep_monitoring);
 
	static SQInteger GetTownDeliveryAmount(ScriptCompany::CompanyID company, CargoID cargo, TownID town_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.
 
@@ -62,7 +62,7 @@ public:
 
	 * @return Amount of delivered cargo of the given cargo type to the given industry by the given company since the last call, or
 
	 * \c -1 if a parameter is out-of-bound.
 
	 */
 
	static int32 GetIndustryDeliveryAmount(ScriptCompany::CompanyID company, CargoID cargo, IndustryID industry_id, bool keep_monitoring);
 
	static SQInteger GetIndustryDeliveryAmount(ScriptCompany::CompanyID company, CargoID cargo, IndustryID industry_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.
 
@@ -74,7 +74,7 @@ public:
 
	 * \c -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 GetTownPickupAmount(ScriptCompany::CompanyID company, CargoID cargo, TownID town_id, bool keep_monitoring);
 
	static SQInteger GetTownPickupAmount(ScriptCompany::CompanyID company, CargoID cargo, TownID town_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.
 
@@ -86,7 +86,7 @@ public:
 
	 * \c -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 GetIndustryPickupAmount(ScriptCompany::CompanyID company, CargoID cargo, IndustryID industry_id, bool keep_monitoring);
 
	static SQInteger GetIndustryPickupAmount(ScriptCompany::CompanyID company, CargoID cargo, IndustryID industry_id, bool keep_monitoring);
 

	
 
	/** Stop monitoring everything. */
 
	static void StopAllMonitoring();
0 comments (0 inline, 0 general)