1 /* $Id: script_infrastructure.hpp 23735 2012-01-03 20:26:05Z rubidium $ */
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
10 /** @file script_infrastructure.hpp Everything to query a company's infrastructure. */
12 #ifndef SCRIPT_INFRASTRUCTURE_HPP
13 #define SCRIPT_INFRASTRUCTURE_HPP
15 #include "script_road.hpp"
16 #include "script_rail.hpp"
19 * Class that handles all company infrastructure related functions.
22 class ScriptInfrastructure
: public ScriptObject
{
24 /** Infrastructure categories. */
26 INFRASTRUCTURE_RAIL
, ///< Rail infrastructure.
27 INFRASTRUCTURE_SIGNALS
, ///< Signal infrastructure.
28 INFRASTRUCTURE_ROAD
, ///< Road infrastructure.
29 INFRASTRUCTURE_CANAL
, ///< Canal infrastructure.
30 INFRASTRUCTURE_STATION
, ///< Station infrastructure.
31 INFRASTRUCTURE_AIRPORT
, ///< Airport infrastructure.
35 * Return the number of rail pieces of a specific rail type for a company.
36 * @param company The company to get the count for.
37 * @param railtype Rail type to get the count of.
38 * @return Count for the rail type.
40 static uint32
GetRailPieceCount(ScriptCompany::CompanyID company
, ScriptRail::RailType railtype
);
43 * Return the number of road pieces of a specific road type for a company.
44 * @param company The company to get the count for.
45 * @param roadtype Road type to get the count of.
46 * @return Count for the road type.
48 static uint32
GetRoadPieceCount(ScriptCompany::CompanyID company
, ScriptRoad::RoadType roadtype
);
51 * Return the number of pieces of an infrastructure category for a company.
52 * @param company The company to get the count for.
53 * @param infra_type Infrastructure category to get the cost of.
54 * @return Count for the wanted category.
55 * @note #INFRASTRUCTURE_RAIL and #INFRASTRUCTURE_ROAD return the total count for all rail/road types.
57 static uint32
GetInfrastructurePieceCount(ScriptCompany::CompanyID company
, Infrastructure infra_type
);
60 * Return the monthly maintenance costs of a specific rail type for a company.
61 * @param company The company to get the monthly cost for.
62 * @param railtype Rail type to get the cost of.
63 * @return Monthly maintenance cost for the rail type.
65 static Money
GetMonthlyRailCosts(ScriptCompany::CompanyID company
, ScriptRail::RailType railtype
);
68 * Return the monthly maintenance costs of a specific road type for a company.
69 * @param company The company to get the monthly cost for.
70 * @param roadtype Road type to get the cost of.
71 * @return Monthly maintenance cost for the road type.
73 static Money
GetMonthlyRoadCosts(ScriptCompany::CompanyID company
, ScriptRoad::RoadType roadtype
);
76 * Return the monthly maintenance costs of an infrastructure category for a company.
77 * @param company The company to get the monthly cost for.
78 * @param infra_type Infrastructure category to get the cost of.
79 * @return Monthly maintenance cost for the wanted category.
80 * @note #INFRASTRUCTURE_RAIL and #INFRASTRUCTURE_ROAD return the total cost for all rail/road types.
82 static Money
GetMonthlyInfrastructureCosts(ScriptCompany::CompanyID company
, Infrastructure infra_type
);
85 #endif /* SCRIPT_INFRASTRUCTURE_HPP */