OpenTTD Source  20241108-master-g80f628063a
engine_func.h
Go to the documentation of this file.
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  */
7 
10 #ifndef ENGINE_FUNC_H
11 #define ENGINE_FUNC_H
12 
13 #include "engine_type.h"
14 #include "vehicle_type.h"
15 #include "company_type.h"
17 
18 void SetupEngines();
19 void StartupEngines();
20 void CheckEngines();
21 
22 /* Original engine data counts and offsets */
23 extern const uint8_t _engine_counts[4];
24 extern const uint8_t _engine_offsets[4];
25 
26 bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company);
27 bool IsEngineRefittable(EngineID engine);
29 void CalcEngineReliability(Engine *e, bool new_month);
30 void StartupOneEngine(Engine *e, const TimerGameCalendar::YearMonthDay &aging_ymd, uint32_t seed);
31 
33 
34 #endif /* ENGINE_FUNC_H */
Types related to companies.
Owner
Enum for all companies/owners.
Definition: company_type.h:18
void SetYearEngineAgingStops()
Compute the value for _year_engine_aging_stops.
Definition: engine.cpp:657
const uint8_t _engine_counts[4]
Number of engines of each vehicle type in original engine data.
Definition: engine.cpp:53
void SetupEngines()
Initialise the engine pool with the data from the original vehicles.
Definition: engine.cpp:565
const uint8_t _engine_offsets[4]
Offset of the first engine of each vehicle type in original engine data.
Definition: engine.cpp:61
uint GetTotalCapacityOfArticulatedParts(EngineID engine)
Get the capacity of an engine with articulated parts.
Definition: engine_gui.cpp:165
bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company)
Check if an engine is buildable.
Definition: engine.cpp:1218
void StartupEngines()
Start/initialise all our engines.
Definition: engine.cpp:763
void StartupOneEngine(Engine *e, const TimerGameCalendar::YearMonthDay &aging_ymd, uint32_t seed)
Start/initialise one engine.
Definition: engine.cpp:682
void CheckEngines()
Check for engines that have an appropriate availability.
Definition: engine.cpp:1285
bool IsEngineRefittable(EngineID engine)
Check if an engine is refittable.
Definition: engine.cpp:1259
void CalcEngineReliability(Engine *e, bool new_month)
Update Engine::reliability and (if needed) update the engine GUIs.
Definition: engine.cpp:611
Types related to engines.
uint16_t EngineID
Unique identification number of an engine.
Definition: engine_type.h:21
Definition of the game-calendar-timer.
Types related to vehicles.
VehicleType
Available vehicle types.
Definition: vehicle_type.h:21