Changeset - r26975:669c2f77fb96
[Not reviewed]
master
0 2 0
glx22 - 21 months ago 2023-03-04 14:50:40
glx@openttd.org
Codechange: Use SQInteger for generic numbers in script_infrastructure
2 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/script/api/script_infrastructure.cpp
Show inline comments
 
@@ -18,7 +18,7 @@
 
#include "../../safeguards.h"
 

	
 

	
 
/* static */ uint32 ScriptInfrastructure::GetRailPieceCount(ScriptCompany::CompanyID company, ScriptRail::RailType railtype)
 
/* static */ SQInteger ScriptInfrastructure::GetRailPieceCount(ScriptCompany::CompanyID company, ScriptRail::RailType railtype)
 
{
 
	company = ScriptCompany::ResolveCompanyID(company);
 
	if (company == ScriptCompany::COMPANY_INVALID || (::RailType)railtype >= RAILTYPE_END) return 0;
 
@@ -26,7 +26,7 @@
 
	return ::Company::Get((::CompanyID)company)->infrastructure.rail[railtype];
 
}
 

	
 
/* static */ uint32 ScriptInfrastructure::GetRoadPieceCount(ScriptCompany::CompanyID company, ScriptRoad::RoadType roadtype)
 
/* static */ SQInteger ScriptInfrastructure::GetRoadPieceCount(ScriptCompany::CompanyID company, ScriptRoad::RoadType roadtype)
 
{
 
	company = ScriptCompany::ResolveCompanyID(company);
 
	if (company == ScriptCompany::COMPANY_INVALID || (::RoadType)roadtype >= ROADTYPE_END) return 0;
 
@@ -34,7 +34,7 @@
 
	return ::Company::Get((::CompanyID)company)->infrastructure.road[roadtype];
 
}
 

	
 
/* static */ uint32 ScriptInfrastructure::GetInfrastructurePieceCount(ScriptCompany::CompanyID company, Infrastructure infra_type)
 
/* static */ SQInteger ScriptInfrastructure::GetInfrastructurePieceCount(ScriptCompany::CompanyID company, Infrastructure infra_type)
 
{
 
	company = ScriptCompany::ResolveCompanyID(company);
 
	if (company == ScriptCompany::COMPANY_INVALID) return 0;
src/script/api/script_infrastructure.hpp
Show inline comments
 
@@ -35,7 +35,7 @@ public:
 
	 * @param railtype Rail type to get the count of.
 
	 * @return Count for the rail type.
 
	 */
 
	static uint32 GetRailPieceCount(ScriptCompany::CompanyID company, ScriptRail::RailType railtype);
 
	static SQInteger GetRailPieceCount(ScriptCompany::CompanyID company, ScriptRail::RailType railtype);
 

	
 
	/**
 
	 * Return the number of road pieces of a specific road type for a company.
 
@@ -43,7 +43,7 @@ public:
 
	 * @param roadtype Road type to get the count of.
 
	 * @return Count for the road type.
 
	 */
 
	static uint32 GetRoadPieceCount(ScriptCompany::CompanyID company, ScriptRoad::RoadType roadtype);
 
	static SQInteger GetRoadPieceCount(ScriptCompany::CompanyID company, ScriptRoad::RoadType roadtype);
 

	
 
	/**
 
	 * Return the number of pieces of an infrastructure category for a company.
 
@@ -52,7 +52,7 @@ public:
 
	 * @return Count for the wanted category.
 
	 * @note #INFRASTRUCTURE_RAIL and #INFRASTRUCTURE_ROAD return the total count for all rail/road types.
 
	 */
 
	static uint32 GetInfrastructurePieceCount(ScriptCompany::CompanyID company, Infrastructure infra_type);
 
	static SQInteger GetInfrastructurePieceCount(ScriptCompany::CompanyID company, Infrastructure infra_type);
 

	
 
	/**
 
	 * Return the monthly maintenance costs of a specific rail type for a company.
0 comments (0 inline, 0 general)