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 
8 /** @file script_vehiclelist.hpp List all the vehicles (you own). */
9 
10 #ifndef SCRIPT_VEHICLELIST_HPP
11 #define SCRIPT_VEHICLELIST_HPP
12 
13 #include "script_list.hpp"
14 #include "script_vehicle.hpp"
15 
16 /**
17  * Creates a list of vehicles of which you are the owner.
18  * @api ai game
19  * @ingroup ScriptList
20  */
21 class ScriptVehicleList : public ScriptList {
22 public:
23 	ScriptVehicleList();
24 };
25 
26 /**
27  * Creates a list of vehicles that have orders to a given station.
28  * @api ai game
29  * @ingroup ScriptList
30  */
31 class ScriptVehicleList_Station : public ScriptList {
32 public:
33 	/**
34 	 * @param station_id The station to get the list of vehicles from, which have orders to it.
35 	 * @pre ScriptBaseStation::IsValidBaseStation(station_id)
36 	 */
37 	ScriptVehicleList_Station(StationID station_id);
38 };
39 
40 /**
41  * Creates a list of vehicles that have orders to a given depot.
42  * The list is created with a tile. If the tile is part of an airport all
43  * aircraft having a depot order on a hangar of that airport will be
44  * returned. For all other vehicle types the tile has to be a depot or
45  * an empty list will be returned.
46  * @api ai game
47  * @ingroup ScriptList
48  */
49 class ScriptVehicleList_Depot : public ScriptList {
50 public:
51 	/**
52 	 * @param tile The tile of the depot to get the list of vehicles from, which have orders to it.
53 	 */
54 	ScriptVehicleList_Depot(TileIndex tile);
55 };
56 
57 /**
58  * Creates a list of vehicles that share orders.
59  * @api ai game
60  * @ingroup ScriptList
61  */
62 class ScriptVehicleList_SharedOrders : public ScriptList {
63 public:
64 	/**
65 	 * @param vehicle_id The vehicle that the rest shared orders with.
66 	 */
67 	ScriptVehicleList_SharedOrders(VehicleID vehicle_id);
68 };
69 
70 /**
71  * Creates a list of vehicles that are in a group.
72  * @api ai
73  * @ingroup ScriptList
74  */
75 class ScriptVehicleList_Group : public ScriptList {
76 public:
77 	/**
78 	 * @param group_id The ID of the group the vehicles are in.
79 	 */
80 	ScriptVehicleList_Group(GroupID group_id);
81 };
82 
83 /**
84  * Creates a list of vehicles that are in the default group.
85  * @api ai
86  * @ingroup ScriptList
87  */
88 class ScriptVehicleList_DefaultGroup : public ScriptList {
89 public:
90 	/**
91 	 * @param vehicle_type The VehicleType to get the list of vehicles for.
92 	 */
93 	ScriptVehicleList_DefaultGroup(ScriptVehicle::VehicleType vehicle_type);
94 };
95 
96 #endif /* SCRIPT_VEHICLELIST_HPP */
97