OpenTTD Source
20241121-master-g67a0fccfad
|
Lists of vehicles. More...
#include "stdafx.h"
#include "train.h"
#include "vehicle_func.h"
#include "vehiclelist.h"
#include "vehiclelist_func.h"
#include "group.h"
#include "safeguards.h"
Go to the source code of this file.
Data Structures | |
struct | BuildDepotVehicleListData |
Data for building a depot vehicle list. More... | |
Functions | |
static Vehicle * | BuildDepotVehicleListProc (Vehicle *v, void *data) |
Add vehicles to a depot vehicle list. More... | |
void | BuildDepotVehicleList (VehicleType type, TileIndex tile, VehicleList *engines, VehicleList *wagons, bool individual_wagons) |
Generate a list of vehicles inside a depot. More... | |
bool | GenerateVehicleSortList (VehicleList *list, const VehicleListIdentifier &vli) |
Generate a list of vehicles based on window type. More... | |
Lists of vehicles.
Definition in file vehiclelist.cpp.
void BuildDepotVehicleList | ( | VehicleType | type, |
TileIndex | tile, | ||
VehicleList * | engines, | ||
VehicleList * | wagons, | ||
bool | individual_wagons | ||
) |
Generate a list of vehicles inside a depot.
type | Type of vehicle |
tile | The tile the depot is located on |
engines | Pointer to list to add vehicles to |
wagons | Pointer to list to add wagons to (can be nullptr) |
individual_wagons | If true add every wagon to wagons which is not attached to an engine. If false only add the first wagon of every row. |
Definition at line 104 of file vehiclelist.cpp.
References BuildDepotVehicleListProc(), and FindVehicleOnPos().
Referenced by CmdDepotMassAutoReplace(), CmdDepotSellAllVehicles(), and CmdMassStartStopVehicle().
Add vehicles to a depot vehicle list.
v | The found vehicle. |
data | The depot vehicle list data. |
Definition at line 78 of file vehiclelist.cpp.
References SpecializedVehicle< T, Type >::First(), SpecializedVehicle< T, Type >::From(), Vehicle::IsArticulatedPart(), GroundVehicle< T, Type >::IsFreeWagon(), Vehicle::IsInDepot(), Vehicle::IsPrimaryVehicle(), GroundVehicle< T, Type >::IsRearDualheaded(), BaseVehicle::type, and VEH_TRAIN.
Referenced by BuildDepotVehicleList().
bool GenerateVehicleSortList | ( | VehicleList * | list, |
const VehicleListIdentifier & | vli | ||
) |
Generate a list of vehicles based on window type.
list | Pointer to list to add vehicles to |
vli | The identifier of this vehicle list. |
Definition at line 119 of file vehiclelist.cpp.
References VehicleListIdentifier::type.
Referenced by CmdMassStartStopVehicle(), and SendAllVehiclesToDepot().