OpenTTD Source: src/engine_func.h Source File

OpenTTD Source 15.3

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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
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"
16#include "timer/timer_game_calendar.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);
28void SetYearEngineAgingStops();
29void CalcEngineReliability(Engine *e, bool new_month);
30void StartupOneEngine(Engine *e, const TimerGameCalendar::YearMonthDay &aging_ymd, uint32_t seed);
31
32uint GetTotalCapacityOfArticulatedParts(EngineID engine);
33
34#endif /* ENGINE_FUNC_H */
Engine
Definition engine_base.h:38
company_type.h
Types related to companies.
SetYearEngineAgingStops
void SetYearEngineAgingStops()
Compute the value for _year_engine_aging_stops.
Definition engine.cpp:692
_engine_counts
const uint8_t _engine_counts[4]
Number of engines of each vehicle type in original engine data.
Definition engine.cpp:54
SetupEngines
void SetupEngines()
Initialise the engine pool with the data from the original vehicles.
Definition engine.cpp:600
_engine_offsets
const uint8_t _engine_offsets[4]
Offset of the first engine of each vehicle type in original engine data.
Definition engine.cpp:62
GetTotalCapacityOfArticulatedParts
uint GetTotalCapacityOfArticulatedParts(EngineID engine)
Get the capacity of an engine with articulated parts.
Definition engine_gui.cpp:162
IsEngineBuildable
bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company)
Check if an engine is buildable.
Definition engine.cpp:1246
StartupEngines
void StartupEngines()
Start/initialise all our engines.
Definition engine.cpp:798
StartupOneEngine
void StartupOneEngine(Engine *e, const TimerGameCalendar::YearMonthDay &aging_ymd, uint32_t seed)
Start/initialise one engine.
Definition engine.cpp:717
CheckEngines
void CheckEngines()
Check for engines that have an appropriate availability.
Definition engine.cpp:1313
IsEngineRefittable
bool IsEngineRefittable(EngineID engine)
Check if an engine is refittable.
Definition engine.cpp:1287
CalcEngineReliability
void CalcEngineReliability(Engine *e, bool new_month)
Update Engine::reliability and (if needed) update the engine GUIs.
Definition engine.cpp:646
engine_type.h
Types related to engines.
PoolID< uint16_t, struct EngineIDTag, 64000, 0xFFFF >
timer_game_calendar.h
Definition of the game-calendar-timer.
vehicle_type.h
Types related to vehicles.
VehicleType
VehicleType
Available vehicle types.
Definition vehicle_type.h:22