OpenTTD Source: src/engine_func.h Source File

OpenTTD Source 12.0-beta1

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"
16
17 void SetupEngines();
18 void StartupEngines();
19 void CheckEngines();
20
21 /* Original engine data counts and offsets */
22 extern const uint8 _engine_counts[4];
23 extern const uint8 _engine_offsets[4];
24
25 bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company);
26 bool IsEngineRefittable(EngineID engine);
27 void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, CargoTypes *refits, CargoID cargo_type, uint cargo_capacity);
28 void SetYearEngineAgingStops();
29 void StartupOneEngine(Engine *e, Date aging_date);
30
31 uint GetTotalCapacityOfArticulatedParts(EngineID engine);
32
33 #endif /* ENGINE_FUNC_H */
SetYearEngineAgingStops
void SetYearEngineAgingStops()
Compute the value for _year_engine_aging_stops.
Definition: engine.cpp:601
SetupEngines
void SetupEngines()
Initialise the engine pool with the data from the original vehicles.
Definition: engine.cpp:529
StartupOneEngine
void StartupOneEngine(Engine *e, Date aging_date)
Start/initialise one engine.
Definition: engine.cpp:626
GetTotalCapacityOfArticulatedParts
uint GetTotalCapacityOfArticulatedParts(EngineID engine)
Get the capacity of an engine with articulated parts.
Definition: engine_gui.cpp:163
CargoArray
Class for storing amounts of cargo.
Definition: cargo_type.h:82
CheckEngines
void CheckEngines()
Check for engines that have an appropriate availability.
Definition: engine.cpp:1182
Engine
Definition: engine_base.h:27
Owner
Owner
Enum for all companies/owners.
Definition: company_type.h:18
IsEngineRefittable
bool IsEngineRefittable(EngineID engine)
Check if an engine is refittable.
Definition: engine.cpp:1156
EngineID
uint16 EngineID
Unique identification number of an engine.
Definition: engine_type.h:21
GetArticulatedVehicleCargoesAndRefits
void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, CargoTypes *refits, CargoID cargo_type, uint cargo_capacity)
Get the default cargoes and refits of an articulated vehicle.
Definition: articulated_vehicles.cpp:172
StartupEngines
void StartupEngines()
Start/initialise all our engines.
Definition: engine.cpp:682
Date
int32 Date
The type to store our dates in.
Definition: date_type.h:14
VehicleType
VehicleType
Available vehicle types.
Definition: vehicle_type.h:21
vehicle_type.h
engine_type.h
CargoID
byte CargoID
Cargo slots to indicate a cargo type within a game.
Definition: cargo_type.h:20
IsEngineBuildable
bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company)
Check if an engine is buildable.
Definition: engine.cpp:1115
_engine_counts
const uint8 _engine_counts[4]
Number of engines of each vehicle type in original engine data.
Definition: engine.cpp:50
company_type.h
_engine_offsets
const uint8 _engine_offsets[4]
Offset of the first engine of each vehicle type in original engine data.
Definition: engine.cpp:58