Fix some daylength issues, possible division by zero in main menu.
[openttd-joker.git] / src / script / api / script_infrastructure.hpp
blob522f1d592389e7f1010b273a44ca5f1541ab8524
1 /* $Id: script_infrastructure.hpp 23735 2012-01-03 20:26:05Z rubidium $ */
3 /*
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/>.
8 */
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"
18 /**
19 * Class that handles all company infrastructure related functions.
20 * @api ai game
22 class ScriptInfrastructure : public ScriptObject {
23 public:
24 /** Infrastructure categories. */
25 enum Infrastructure {
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.
34 /**
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);
42 /**
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);
50 /**
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);
59 /**
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);
67 /**
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);
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 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 */