summaryrefslogtreecommitdiff
path: root/src/articulated_vehicles.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-05-02 20:59:54 +0000
committerrubidium <rubidium@openttd.org>2011-05-02 20:59:54 +0000
commitff143c67085ad22abb5f6920873fd0ff9eddf603 (patch)
treef4f5fe046bd9b07d8a9c20130d7e115eb80f45ba /src/articulated_vehicles.cpp
parentcf30941fab66fe6232e5b15b59ebedc4ea430e1e (diff)
downloadopenttd-ff143c67085ad22abb5f6920873fd0ff9eddf603.tar.xz
(svn r22413) -Document: even more stuff
Diffstat (limited to 'src/articulated_vehicles.cpp')
-rw-r--r--src/articulated_vehicles.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/articulated_vehicles.cpp b/src/articulated_vehicles.cpp
index 0ef4d9bc4..2350dcb92 100644
--- a/src/articulated_vehicles.cpp
+++ b/src/articulated_vehicles.cpp
@@ -40,6 +40,12 @@ static EngineID GetNextArticulatedPart(uint index, EngineID front_type, Vehicle
return GetNewEngineID(GetEngineGRF(front_type), Engine::Get(front_type)->type, GB(callback, 0, 7));
}
+/**
+ * Count the number of articulated parts of an engine.
+ * @param engine_type The engine to get the number of parts of.
+ * @param purchase_window Whether we are in the scope of the purchase window or not, i.e. whether we cannot allocate vehicles.
+ * @return The nmumber of parts.
+ */
uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
{
if (!HasBit(EngInfo(engine_type)->callback_mask, CBM_VEHICLE_ARTIC_ENGINE)) return 0;
@@ -101,6 +107,11 @@ static inline uint32 GetAvailableVehicleCargoTypes(EngineID engine, bool include
return cargos;
}
+/**
+ * Get the capacity of the parts of a given engine.
+ * @param engine The engine to get the capacities from.
+ * @return The cargo capacities.
+ */
CargoArray GetCapacityOfArticulatedParts(EngineID engine)
{
CargoArray capacity;
@@ -276,6 +287,10 @@ void CheckConsistencyOfArticulatedVehicle(const Vehicle *v)
}
}
+/**
+ * Add the remaining articulated parts to the given vehicle.
+ * @param first The head of the articulated bit.
+ */
void AddArticulatedParts(Vehicle *first)
{
VehicleType type = first->type;