10 #ifndef VEHICLELIST_FUNC_H
11 #define VEHICLELIST_FUNC_H
23 template <
class VehiclePredicate,
class OrderPredicate,
class VehicleFunc>
29 Vehicle *v = orderlist->GetFirstSharedVehicle();
30 if (!veh_pred(v))
continue;
33 for (
const Order *order = orderlist->GetFirstOrder(); order !=
nullptr; order = order->
next) {
35 if (!ord_pred(order))
continue;
Shared order list linking together the linked list of orders and the list of vehicles sharing this or...
Order * next
Pointer to next order. If nullptr, end of list.
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
Vehicle * NextShared() const
Get the next vehicle of the shared vehicle chain.
Base class for all vehicles.
void FindVehiclesWithOrder(VehiclePredicate veh_pred, OrderPredicate ord_pred, VehicleFunc veh_func)
Find vehicles matching an order.