--- a/src/ai/api/ai_vehicle.hpp Fri Jul 13 19:54:59 2007 +0000
+++ b/src/ai/api/ai_vehicle.hpp Fri Jul 13 23:18:12 2007 +0000
@@ -6,6 +6,7 @@
#define AI_VEHICLE_HPP
#include "ai_object.hpp"
+#include "../../vehicle.h"
/**
* Class that handles all vehicle related functions.
@@ -36,8 +37,6 @@
* @param cargo the cargo the vehicle has to transport.
* @param min_reliability the minimum reliability of the vehicle,
* between 0 and 100.
- * @pre the tile at depot has a depot that can build the engine and
- * is owned by you.
* @pre AICargo::IsValidCargo(cargo).
* @pre min_reliability is between 0 and 100.
* @return the engine with the best characteristics, or an invalid engine
@@ -47,6 +46,19 @@
EngineID FindBestRoadVehicle(CargoID cargo, uint8 min_reliability);
/**
+ * Find the best aircraft for this job, given a minimum reliability.
+ * @param cargo the cargo the vehicle has to transport.
+ * @param min_reliability the minimum reliability of the vehicle,
+ * between 0 and 100.
+ * @pre AICargo::IsValidCargo(cargo).
+ * @pre min_reliability is between 0 and 100.
+ * @return the engine with the best characteristics, or an invalid engine
+ * when no engine was found given the cargo and reliability. Check the
+ * return value using IsValidEngine.
+ */
+ EngineID FindBestAircraftVehicle(CargoID cargo, uint8 min_reliability);
+
+ /**
* Builds a vehicle with the given engine at the given depot.
* @param depot the depot where the vehicle will be build.
* @param engine_id the engine to use for this vehicle.
@@ -188,6 +200,9 @@
* @return the profit the vehicle had last year.
*/
static int32 GetProfitLastYear(VehicleID vehicle_id);
+
+private:
+ EngineID FindBestVehicle(CargoID cargo, uint8 min_reliability, VehicleType veh_type);
};
#endif /* AI_VEHICLE_HPP */