OpenTTD Source 20241224-master-gf74b0cf984
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
18void SetupEngines();
19void StartupEngines();
20void CheckEngines();
21
22/* Original engine data counts and offsets */
23extern const uint8_t _engine_counts[4];
24extern const uint8_t _engine_offsets[4];
25
26bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company);
27bool IsEngineRefittable(EngineID engine);
29void CalcEngineReliability(Engine *e, bool new_month);
30void 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.
void SetYearEngineAgingStops()
Compute the value for _year_engine_aging_stops.
Definition engine.cpp:693
const uint8_t _engine_counts[4]
Number of engines of each vehicle type in original engine data.
Definition engine.cpp:54
void SetupEngines()
Initialise the engine pool with the data from the original vehicles.
Definition engine.cpp:601
const uint8_t _engine_offsets[4]
Offset of the first engine of each vehicle type in original engine data.
Definition engine.cpp:62
uint GetTotalCapacityOfArticulatedParts(EngineID engine)
Get the capacity of an engine with articulated parts.
bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company)
Check if an engine is buildable.
Definition engine.cpp:1254
void StartupEngines()
Start/initialise all our engines.
Definition engine.cpp:799
void StartupOneEngine(Engine *e, const TimerGameCalendar::YearMonthDay &aging_ymd, uint32_t seed)
Start/initialise one engine.
Definition engine.cpp:718
void CheckEngines()
Check for engines that have an appropriate availability.
Definition engine.cpp:1321
bool IsEngineRefittable(EngineID engine)
Check if an engine is refittable.
Definition engine.cpp:1295
void CalcEngineReliability(Engine *e, bool new_month)
Update Engine::reliability and (if needed) update the engine GUIs.
Definition engine.cpp:647
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.