Update: Translations from eints
[openttd-github.git] / src / script / api / script_infrastructure.hpp
blob79ced1b586de3172ef5490585bae5ad77f81ba4e
1 /*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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/>.
6 */
8 /** @file script_infrastructure.hpp Everything to query a company's infrastructure. */
10 #ifndef SCRIPT_INFRASTRUCTURE_HPP
11 #define SCRIPT_INFRASTRUCTURE_HPP
13 #include "script_road.hpp"
14 #include "script_rail.hpp"
16 /**
17 * Class that handles all company infrastructure related functions.
18 * @api ai game
20 class ScriptInfrastructure : public ScriptObject {
21 public:
22 /** Infrastructure categories. */
23 enum Infrastructure {
24 INFRASTRUCTURE_RAIL, ///< Rail infrastructure.
25 INFRASTRUCTURE_SIGNALS, ///< Signal infrastructure.
26 INFRASTRUCTURE_ROAD, ///< Road infrastructure.
27 INFRASTRUCTURE_CANAL, ///< Canal infrastructure.
28 INFRASTRUCTURE_STATION, ///< Station infrastructure.
29 INFRASTRUCTURE_AIRPORT, ///< Airport infrastructure.
32 /**
33 * Return the number of rail pieces of a specific rail type for a company.
34 * @param company The company to get the count for.
35 * @param railtype Rail type to get the count of.
36 * @return Count for the rail type.
38 static SQInteger GetRailPieceCount(ScriptCompany::CompanyID company, ScriptRail::RailType railtype);
40 /**
41 * Return the number of road pieces of a specific road type for a company.
42 * @param company The company to get the count for.
43 * @param roadtype Road type to get the count of.
44 * @return Count for the road type.
46 static SQInteger GetRoadPieceCount(ScriptCompany::CompanyID company, ScriptRoad::RoadType roadtype);
48 /**
49 * Return the number of pieces of an infrastructure category for a company.
50 * @param company The company to get the count for.
51 * @param infra_type Infrastructure category to get the cost of.
52 * @return Count for the wanted category.
53 * @note #INFRASTRUCTURE_RAIL and #INFRASTRUCTURE_ROAD return the total count for all rail/road types.
55 static SQInteger GetInfrastructurePieceCount(ScriptCompany::CompanyID company, Infrastructure infra_type);
57 /**
58 * Return the monthly maintenance costs of a specific rail type for a company.
59 * @param company The company to get the monthly cost for.
60 * @param railtype Rail type to get the cost of.
61 * @return Maintenance cost for the rail type per economy-month.
62 * @see \ref ScriptEconomyTime
64 static Money GetMonthlyRailCosts(ScriptCompany::CompanyID company, ScriptRail::RailType railtype);
66 /**
67 * Return the monthly maintenance costs of a specific road type for a company.
68 * @param company The company to get the monthly cost for.
69 * @param roadtype Road type to get the cost of.
70 * @return Maintenance cost for the road type per economy-month.
71 * @see \ref ScriptEconomyTime
73 static Money GetMonthlyRoadCosts(ScriptCompany::CompanyID company, ScriptRoad::RoadType roadtype);
75 /**
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 Maintenance cost for the wanted category per economy-month.
80 * @note #INFRASTRUCTURE_RAIL and #INFRASTRUCTURE_ROAD return the total cost for all rail/road types.
81 * @see \ref ScriptEconomyTime
83 static Money GetMonthlyInfrastructureCosts(ScriptCompany::CompanyID company, Infrastructure infra_type);
86 #endif /* SCRIPT_INFRASTRUCTURE_HPP */