Go to the documentation of this file.
1 /* $Id: engine_func.h 26849 2014-09-18 19:53:22Z alberth $ */
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 <>.
8  */
12 #ifndef ENGINE_FUNC_H
13 #define ENGINE_FUNC_H
15 #include "engine_type.h"
16 #include "vehicle_type.h"
17 #include "company_type.h"
19 void SetupEngines();
20 void StartupEngines();
21 void CheckEngines();
23 /* Original engine data counts and offsets */
24 extern const uint8 _engine_counts[4];
25 extern const uint8 _engine_offsets[4];
27 bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company);
28 bool IsEngineRefittable(EngineID engine);
29 void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, uint32 *refits);
31 void StartupOneEngine(Engine *e, Date aging_date);
35 #endif /* ENGINE_FUNC_H */
void StartupEngines()
Start/initialise all our engines.
Definition: engine.cpp:688
Types related to engines.
bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company)
Check if an engine is buildable.
Definition: engine.cpp:1066
const uint8 _engine_counts[4]
Number of engines of each vehicle type in original engine data.
Definition: engine.cpp:52
Available vehicle types.
Definition: vehicle_type.h:21
void SetupEngines()
Initialise the engine pool with the data from the original vehicles.
Definition: engine.cpp:545
void StartupOneEngine(Engine *e, Date aging_date)
Start/initialise one engine.
Definition: engine.cpp:643
const uint8 _engine_offsets[4]
Offset of the first engine of each vehicle type in original engine data.
Definition: engine.cpp:60
void CheckEngines()
Check for engines that have an appropriate availability.
Definition: engine.cpp:1126
void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, uint32 *refits)
Get the default cargoes and refits of an articulated vehicle.
uint GetTotalCapacityOfArticulatedParts(EngineID engine)
Get the capacity of an engine with articulated parts.
Definition: engine_gui.cpp:163
Class for storing amounts of cargo.
Definition: cargo_type.h:74
void SetYearEngineAgingStops()
Compute the value for _year_engine_aging_stops.
Definition: engine.cpp:617
uint16 EngineID
Unique identification number of an engine.
Definition: engine_type.h:22
Types related to vehicles.
Types related to companies.
bool IsEngineRefittable(EngineID engine)
Check if an engine is refittable.
Definition: engine.cpp:1102
int32 Date
The type to store our dates in.
Definition: date_type.h:16
Enum for all companies/owners.
Definition: company_type.h:20