OpenTTD Source 20241224-master-gee860a5c8e
|
Functions and type for generating vehicle lists. More...
Go to the source code of this file.
Data Structures | |
struct | VehicleListIdentifier |
The information about a vehicle list. More... | |
Typedefs | |
typedef std::vector< const Vehicle * > | VehicleList |
A list of vehicles. | |
Enumerations | |
enum | VehicleListType : uint8_t { VL_STANDARD , VL_SHARED_ORDERS , VL_STATION_LIST , VL_DEPOT_LIST , VL_GROUP_LIST , VLT_END } |
Vehicle List type flags. More... | |
Functions | |
bool | GenerateVehicleSortList (VehicleList *list, const VehicleListIdentifier &identifier) |
Generate a list of vehicles based on window type. | |
void | BuildDepotVehicleList (VehicleType type, TileIndex tile, VehicleList *engine_list, VehicleList *wagon_list, bool individual_wagons=false) |
Generate a list of vehicles inside a depot. | |
uint | GetUnitNumberDigits (VehicleList &vehicles) |
Get the number of digits the biggest unit number of a set of vehicles has. | |
Functions and type for generating vehicle lists.
Definition in file vehiclelist.h.
typedef std::vector<const Vehicle *> VehicleList |
A list of vehicles.
Definition at line 54 of file vehiclelist.h.
enum VehicleListType : uint8_t |
Vehicle List type flags.
Definition at line 18 of file vehiclelist.h.
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().
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 ALL_GROUP, VehicleListIdentifier::company, FindVehiclesWithOrder(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::group_id, GroupIsInGroup(), VehicleListIdentifier::index, Vehicle::IsPrimaryVehicle(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::Iterate(), Vehicle::NextShared(), ODATFB_NEAREST_DEPOT, Vehicle::owner, BaseVehicle::type, VehicleListIdentifier::type, and VehicleListIdentifier::vtype.
Referenced by CmdAddVehicleGroup(), CmdMassStartStopVehicle(), and SendAllVehiclesToDepot().
uint GetUnitNumberDigits | ( | VehicleList & | vehicles | ) |
Get the number of digits the biggest unit number of a set of vehicles has.
vehicles | The list of vehicles. |
Definition at line 208 of file vehicle_gui.cpp.
References CountDigitsForAllocatingSpace().
Referenced by DepotWindow::OnPaint().