OpenTTD

articulated_vehicles.h
Go to the documentation of this file.
1 /* $Id: articulated_vehicles.h 24029 2012-03-14 20:49:54Z yexo $ */
2
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 <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef ARTICULATED_VEHICLES_H
13 #define ARTICULATED_VEHICLES_H
14
15 #include "vehicle_type.h"
16 #include "engine_type.h"
17
18 uint CountArticulatedParts(EngineID engine_type, bool purchase_window);
19 CargoArray GetCapacityOfArticulatedParts(EngineID engine);
20 void AddArticulatedParts(Vehicle *first);
21 void GetArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type, uint32 *union_mask, uint32 *intersection_mask);
22 uint32 GetUnionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type);
23 uint32 GetIntersectionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type);
24 bool IsArticulatedVehicleCarryingDifferentCargoes(const Vehicle *v, CargoID *cargo_type);
25 bool IsArticulatedVehicleRefittable(EngineID engine);
26 bool IsArticulatedEngine(EngineID engine_type);
27 void CheckConsistencyOfArticulatedVehicle(const Vehicle *v);
28
29
30 #endif /* ARTICULATED_VEHICLES_H */
GetIntersectionOfArticulatedRefitMasks
uint32 GetIntersectionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type)
Ands the refit_masks of all articulated parts.
Definition: articulated_vehicles.cpp:270
engine_type.h
Types related to engines.
IsArticulatedVehicleRefittable
bool IsArticulatedVehicleRefittable(EngineID engine)
Checks whether any of the articulated parts is refittable.
Definition: articulated_vehicles.cpp:205
Vehicle
Vehicle data structure.
Definition: vehicle_base.h:212
GetArticulatedRefitMasks
void GetArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type, uint32 *union_mask, uint32 *intersection_mask)
Merges the refit_masks of all articulated parts.
Definition: articulated_vehicles.cpp:231
GetUnionOfArticulatedRefitMasks
uint32 GetUnionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type)
Ors the refit_masks of all articulated parts.
Definition: articulated_vehicles.cpp:257
CheckConsistencyOfArticulatedVehicle
void CheckConsistencyOfArticulatedVehicle(const Vehicle *v)
Checks whether the specs of freshly build articulated vehicles are consistent with the information sp...
Definition: articulated_vehicles.cpp:313
IsArticulatedEngine
bool IsArticulatedEngine(EngineID engine_type)
Does a NewGRF report that this should be an articulated vehicle?
Definition: articulated_vehicles.cpp:64
GetCapacityOfArticulatedParts
CargoArray GetCapacityOfArticulatedParts(EngineID engine)
Get the capacity of the parts of a given engine.
Definition: articulated_vehicles.cpp:141
CargoArray
Class for storing amounts of cargo.
Definition: cargo_type.h:74
EngineID
uint16 EngineID
Unique identification number of an engine.
Definition: engine_type.h:22
vehicle_type.h
Types related to vehicles.
CountArticulatedParts
uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
Count the number of articulated parts of an engine.
Definition: articulated_vehicles.cpp:75
CargoID
byte CargoID
Cargo slots to indicate a cargo type within a game.
Definition: cargo_type.h:22
AddArticulatedParts
void AddArticulatedParts(Vehicle *first)
Add the remaining articulated parts to the given vehicle.
Definition: articulated_vehicles.cpp:355
IsArticulatedVehicleCarryingDifferentCargoes
bool IsArticulatedVehicleCarryingDifferentCargoes(const Vehicle *v, CargoID *cargo_type)
Tests if all parts of an articulated vehicle are refitted to the same cargo.
Definition: articulated_vehicles.cpp:285