OpenTTD Source  20240919-master-gdf0233f4c2
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 */
SetYearEngineAgingStops
void SetYearEngineAgingStops()
Compute the value for _year_engine_aging_stops.
Definition: engine.cpp:657
SetupEngines
void SetupEngines()
Initialise the engine pool with the data from the original vehicles.
Definition: engine.cpp:565
timer_game_calendar.h
GetTotalCapacityOfArticulatedParts
uint GetTotalCapacityOfArticulatedParts(EngineID engine)
Get the capacity of an engine with articulated parts.
Definition: engine_gui.cpp:165
Owner
Owner
Enum for all companies/owners.
Definition: company_type.h:18
CheckEngines
void CheckEngines()
Check for engines that have an appropriate availability.
Definition: engine.cpp:1285
_engine_counts
const uint8_t _engine_counts[4]
Number of engines of each vehicle type in original engine data.
Definition: engine.cpp:53
Engine
Definition: engine_base.h:37
IsEngineRefittable
bool IsEngineRefittable(EngineID engine)
Check if an engine is refittable.
Definition: engine.cpp:1259
CalcEngineReliability
void CalcEngineReliability(Engine *e, bool new_month)
Update Engine::reliability and (if needed) update the engine GUIs.
Definition: engine.cpp:611
StartupEngines
void StartupEngines()
Start/initialise all our engines.
Definition: engine.cpp:763
_engine_offsets
const uint8_t _engine_offsets[4]
Offset of the first engine of each vehicle type in original engine data.
Definition: engine.cpp:61
vehicle_type.h
engine_type.h
StartupOneEngine
void StartupOneEngine(Engine *e, const TimerGameCalendar::YearMonthDay &aging_ymd, uint32_t seed)
Start/initialise one engine.
Definition: engine.cpp:682
VehicleType
VehicleType
Available vehicle types.
Definition: vehicle_type.h:21
EngineID
uint16_t EngineID
Unique identification number of an engine.
Definition: engine_type.h:21
IsEngineBuildable
bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company)
Check if an engine is buildable.
Definition: engine.cpp:1218
company_type.h