Class that handles all company infrastructure related functions. More...
#include <script_infrastructure.hpp>
Public Types | |
enum | Infrastructure { INFRASTRUCTURE_RAIL, INFRASTRUCTURE_SIGNALS, INFRASTRUCTURE_ROAD, INFRASTRUCTURE_CANAL, INFRASTRUCTURE_STATION, INFRASTRUCTURE_AIRPORT } |
Infrastructure categories. More... | |
Static Public Member Functions | |
static uint32 | GetRailPieceCount (ScriptCompany::CompanyID company, ScriptRail::RailType railtype) |
Return the number of rail pieces of a specific rail type for a company. | |
static uint32 | GetRoadPieceCount (ScriptCompany::CompanyID company, ScriptRoad::RoadType roadtype) |
Return the number of road pieces of a specific road type for a company. | |
static uint32 | GetInfrastructurePieceCount (ScriptCompany::CompanyID company, Infrastructure infra_type) |
Return the number of pieces of an infrastructure category for a company. | |
static Money | GetMonthlyRailCosts (ScriptCompany::CompanyID company, ScriptRail::RailType railtype) |
Return the monthly maintenance costs of a specific rail type for a company. | |
static Money | GetMonthlyRoadCosts (ScriptCompany::CompanyID company, ScriptRoad::RoadType roadtype) |
Return the monthly maintenance costs of a specific road type for a company. | |
static Money | GetMonthlyInfrastructureCosts (ScriptCompany::CompanyID company, Infrastructure infra_type) |
Return the monthly maintenance costs of an infrastructure category for a company. |
Class that handles all company infrastructure related functions.
ai game
Definition at line 23 of file script_infrastructure.hpp.
Infrastructure categories.
INFRASTRUCTURE_RAIL |
Rail infrastructure. |
INFRASTRUCTURE_SIGNALS |
Signal infrastructure. |
INFRASTRUCTURE_ROAD |
Road infrastructure. |
INFRASTRUCTURE_CANAL |
Canal infrastructure. |
INFRASTRUCTURE_STATION |
Station infrastructure. |
INFRASTRUCTURE_AIRPORT |
Airport infrastructure. |
Definition at line 26 of file script_infrastructure.hpp.
uint32 ScriptInfrastructure::GetInfrastructurePieceCount | ( | ScriptCompany::CompanyID | company, | |
Infrastructure | infra_type | |||
) | [static] |
Return the number of pieces of an infrastructure category for a company.
company | The company to get the count for. | |
infra_type | Infrastructure category to get the cost of. |
Definition at line 38 of file script_infrastructure.cpp.
References ScriptCompany::COMPANY_INVALID, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), INFRASTRUCTURE_AIRPORT, INFRASTRUCTURE_CANAL, INFRASTRUCTURE_RAIL, INFRASTRUCTURE_ROAD, INFRASTRUCTURE_SIGNALS, INFRASTRUCTURE_STATION, RAILTYPE_BEGIN, ScriptCompany::ResolveCompanyID(), and ROADTYPE_BEGIN.
Money ScriptInfrastructure::GetMonthlyInfrastructureCosts | ( | ScriptCompany::CompanyID | company, | |
Infrastructure | infra_type | |||
) | [static] |
Return the monthly maintenance costs of an infrastructure category for a company.
company | The company to get the monthly cost for. | |
infra_type | Infrastructure category to get the cost of. |
Definition at line 94 of file script_infrastructure.cpp.
References _settings_game, AirportMaintenanceCost(), CanalMaintenanceCost(), ScriptCompany::COMPANY_INVALID, GameSettings::economy, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), INFRASTRUCTURE_AIRPORT, INFRASTRUCTURE_CANAL, EconomySettings::infrastructure_maintenance, INFRASTRUCTURE_RAIL, INFRASTRUCTURE_ROAD, INFRASTRUCTURE_SIGNALS, INFRASTRUCTURE_STATION, RailMaintenanceCost(), RAILTYPE_BEGIN, ScriptCompany::ResolveCompanyID(), RoadMaintenanceCost(), ROADTYPE_BEGIN, SignalMaintenanceCost(), and StationMaintenanceCost().
Money ScriptInfrastructure::GetMonthlyRailCosts | ( | ScriptCompany::CompanyID | company, | |
ScriptRail::RailType | railtype | |||
) | [static] |
Return the monthly maintenance costs of a specific rail type for a company.
company | The company to get the monthly cost for. | |
railtype | Rail type to get the cost of. |
Definition at line 78 of file script_infrastructure.cpp.
References _settings_game, ScriptCompany::COMPANY_INVALID, GameSettings::economy, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), EconomySettings::infrastructure_maintenance, RailMaintenanceCost(), RAILTYPE_END, and ScriptCompany::ResolveCompanyID().
Money ScriptInfrastructure::GetMonthlyRoadCosts | ( | ScriptCompany::CompanyID | company, | |
ScriptRoad::RoadType | roadtype | |||
) | [static] |
Return the monthly maintenance costs of a specific road type for a company.
company | The company to get the monthly cost for. | |
roadtype | Road type to get the cost of. |
Definition at line 86 of file script_infrastructure.cpp.
References _settings_game, ScriptCompany::COMPANY_INVALID, GameSettings::economy, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), EconomySettings::infrastructure_maintenance, ScriptCompany::ResolveCompanyID(), RoadMaintenanceCost(), and ROADTYPE_END.
uint32 ScriptInfrastructure::GetRailPieceCount | ( | ScriptCompany::CompanyID | company, | |
ScriptRail::RailType | railtype | |||
) | [static] |
Return the number of rail pieces of a specific rail type for a company.
company | The company to get the count for. | |
railtype | Rail type to get the count of. |
Definition at line 22 of file script_infrastructure.cpp.
References ScriptCompany::COMPANY_INVALID, RAILTYPE_END, and ScriptCompany::ResolveCompanyID().
uint32 ScriptInfrastructure::GetRoadPieceCount | ( | ScriptCompany::CompanyID | company, | |
ScriptRoad::RoadType | roadtype | |||
) | [static] |
Return the number of road pieces of a specific road type for a company.
company | The company to get the count for. | |
roadtype | Road type to get the count of. |
Definition at line 30 of file script_infrastructure.cpp.
References ScriptCompany::COMPANY_INVALID, ScriptCompany::ResolveCompanyID(), and ROADTYPE_END.