--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ai/api/ai_vehiclelist_valuator.cpp Fri May 04 19:55:35 2007 +0000
@@ -0,0 +1,50 @@
+#include "ai_vehiclelist_valuator.hpp"
+#include "../../vehicle.h"
+
+int32 AIVehicleListLocation::Valuate(int32 vehicle) const
+{
+ if (!IsValidVehicleID(vehicle)) return 0;
+ return GetVehicle(vehicle)->tile;
+}
+
+int32 AIVehicleListEngineType::Valuate(int32 vehicle) const
+{
+ if (!IsValidVehicleID(vehicle)) return 0;
+ return GetVehicle(vehicle)->engine_type;
+}
+
+int32 AIVehicleListUnitNumber::Valuate(int32 vehicle) const
+{
+ if (!IsValidVehicleID(vehicle)) return 0;
+ return GetVehicle(vehicle)->unitnumber;
+}
+
+int32 AIVehicleListAge::Valuate(int32 vehicle) const
+{
+ if (!IsValidVehicleID(vehicle)) return 0;
+ return GetVehicle(vehicle)->age;
+}
+
+int32 AIVehicleListMaxAge::Valuate(int32 vehicle) const
+{
+ if (!IsValidVehicleID(vehicle)) return 0;
+ return GetVehicle(vehicle)->max_age;
+}
+
+int32 AIVehicleListAgeLeft::Valuate(int32 vehicle) const
+{
+ if (!IsValidVehicleID(vehicle)) return 0;
+ return GetVehicle(vehicle)->max_age - GetVehicle(vehicle)->age;
+}
+
+int32 AIVehicleListProfitThisYear::Valuate(int32 vehicle) const
+{
+ if (!IsValidVehicleID(vehicle)) return 0;
+ return GetVehicle(vehicle)->profit_this_year;
+}
+
+int32 AIVehicleListProfitLastYear::Valuate(int32 vehicle) const
+{
+ if (!IsValidVehicleID(vehicle)) return 0;
+ return GetVehicle(vehicle)->profit_last_year;
+}