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