OpenTTD Source 20250205-master-gfd85ab1e2c
vehiclelist.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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/>.
6 */
7
10#ifndef VEHICLELIST_H
11#define VEHICLELIST_H
12
13#include "vehicle_type.h"
14#include "company_type.h"
15#include "tile_type.h"
16#include "window_type.h"
17
19enum VehicleListType : uint8_t {
20 VL_STANDARD,
21 VL_SHARED_ORDERS,
22 VL_STATION_LIST,
23 VL_DEPOT_LIST,
24 VL_GROUP_LIST,
25 VLT_END
26};
27
51
53typedef std::vector<const Vehicle *> VehicleList;
54
55bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &identifier);
56void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine_list, VehicleList *wagon_list, bool individual_wagons = false);
57uint GetUnitNumberDigits(VehicleList &vehicles);
58
59#endif /* VEHICLELIST_H */
Types related to companies.
Owner
Enum for all companies/owners.
The information about a vehicle list.
Definition vehiclelist.h:29
VehicleListType type
The type of vehicle list.
Definition vehiclelist.h:30
CompanyID company
The company associated with this list.
Definition vehiclelist.h:32
WindowNumber ToWindowNumber() const
Pack a VehicleListIdentifier in 32 bits so it can be used as unique WindowNumber.
VehicleType vtype
The vehicle type associated with this list.
Definition vehiclelist.h:31
VehicleListIdentifier(VehicleListType type, VehicleType vtype, CompanyID company, uint index=0)
Create a simple vehicle list.
Definition vehiclelist.h:46
uint32_t index
A vehicle list type specific index.
Definition vehiclelist.h:33
Number to differentiate different windows of the same class.
Types related to tiles.
Types related to vehicles.
VehicleType
Available vehicle types.
uint GetUnitNumberDigits(VehicleList &vehicles)
Get the number of digits the biggest unit number of a set of vehicles has.
std::vector< const Vehicle * > VehicleList
A list of vehicles.
Definition vehiclelist.h:53
void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine_list, VehicleList *wagon_list, bool individual_wagons=false)
Generate a list of vehicles inside a depot.
bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &identifier)
Generate a list of vehicles based on window type.
VehicleListType
Vehicle List type flags.
Definition vehiclelist.h:19
Types related to windows.