OpenTTD Source 20260208-master-g43af8e94d0
vehiclelist_func.h File Reference

Functions and type for generating vehicle lists. More...

#include "order_base.h"
#include "vehicle_base.h"

Go to the source code of this file.

Functions

template<class VehiclePredicate, class OrderPredicate, class VehicleFunc>
void FindVehiclesWithOrder (VehiclePredicate veh_pred, OrderPredicate ord_pred, VehicleFunc veh_func)
 Find vehicles matching an order.

Detailed Description

Functions and type for generating vehicle lists.

Definition in file vehiclelist_func.h.

Function Documentation

◆ FindVehiclesWithOrder()

template<class VehiclePredicate, class OrderPredicate, class VehicleFunc>
void FindVehiclesWithOrder ( VehiclePredicate veh_pred,
OrderPredicate ord_pred,
VehicleFunc veh_func )

Find vehicles matching an order.

This can be used, e.g. to find all vehicles that stop at a particular station.

Parameters
veh_predVehicle selection predicate. This is called only for the first vehicle using the order list.
ord_predOrder selection predicate.
veh_funcCalled for each vehicle that matches both vehicle and order predicates.

Definition at line 24 of file vehiclelist_func.h.

References Vehicle::NextShared().

Referenced by GenerateVehicleSortList(), and RemoveRoadStop().