Public Types | Static Public Member Functions

ScriptInfrastructure Class Reference

Class that handles all company infrastructure related functions. More...

#include <script_infrastructure.hpp>

Inheritance diagram for ScriptInfrastructure:
ScriptObject SimpleCountedObject

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.

Detailed Description

Class that handles all company infrastructure related functions.

ai

Definition at line 23 of file script_infrastructure.hpp.


Member Enumeration Documentation

Infrastructure categories.

Enumerator:
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.


Member Function Documentation

uint32 ScriptInfrastructure::GetInfrastructurePieceCount ( ScriptCompany::CompanyID  company,
Infrastructure  infra_type 
) [static]

Return the number of pieces of an infrastructure category for a company.

Parameters:
company The company to get the count for.
infra_type Infrastructure category to get the cost of.
Returns:
Count for the wanted category.
Note:
INFRASTRUCTURE_RAIL and INFRASTRUCTURE_ROAD return the total count for all rail/road types.

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.

Parameters:
company The company to get the monthly cost for.
infra_type Infrastructure category to get the cost of.
Returns:
Monthly maintenance cost for the wanted category.
Note:
INFRASTRUCTURE_RAIL and INFRASTRUCTURE_ROAD return the total cost for all rail/road types.

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.

Parameters:
company The company to get the monthly cost for.
railtype Rail type to get the cost of.
Returns:
Monthly maintenance cost for the rail type.

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.

Parameters:
company The company to get the monthly cost for.
roadtype Road type to get the cost of.
Returns:
Monthly maintenance cost for the road type.

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.

Parameters:
company The company to get the count for.
railtype Rail type to get the count of.
Returns:
Count for the rail type.

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.

Parameters:
company The company to get the count for.
roadtype Road type to get the count of.
Returns:
Count for the road type.

Definition at line 30 of file script_infrastructure.cpp.

References ScriptCompany::COMPANY_INVALID, ScriptCompany::ResolveCompanyID(), and ROADTYPE_END.


The documentation for this class was generated from the following files: