1 #include "ai_vehiclelist_valuator.hpp" |
1 #include "ai_vehiclelist_valuator.hpp" |
2 #include "../../vehicle.h" |
2 #include "ai_vehicle.hpp" |
3 |
3 |
4 int32 AIVehicleListLocation::Valuate(int32 vehicle) const |
4 int32 AIVehicleListLocation::Valuate(int32 vehicle) const |
5 { |
5 { |
6 if (!IsValidVehicleID(vehicle)) return 0; |
6 return AIVehicle::GetLocation(vehicle); |
7 return GetVehicle(vehicle)->tile; |
|
8 } |
7 } |
9 |
8 |
10 int32 AIVehicleListEngineType::Valuate(int32 vehicle) const |
9 int32 AIVehicleListEngineType::Valuate(int32 vehicle) const |
11 { |
10 { |
12 if (!IsValidVehicleID(vehicle)) return 0; |
11 return AIVehicle::GetEngineType(vehicle); |
13 return GetVehicle(vehicle)->engine_type; |
|
14 } |
12 } |
15 |
13 |
16 int32 AIVehicleListUnitNumber::Valuate(int32 vehicle) const |
14 int32 AIVehicleListUnitNumber::Valuate(int32 vehicle) const |
17 { |
15 { |
18 if (!IsValidVehicleID(vehicle)) return 0; |
16 return AIVehicle::GetUnitNumber(vehicle); |
19 return GetVehicle(vehicle)->unitnumber; |
|
20 } |
17 } |
21 |
18 |
22 int32 AIVehicleListAge::Valuate(int32 vehicle) const |
19 int32 AIVehicleListAge::Valuate(int32 vehicle) const |
23 { |
20 { |
24 if (!IsValidVehicleID(vehicle)) return 0; |
21 return AIVehicle::GetAge(vehicle); |
25 return GetVehicle(vehicle)->age; |
|
26 } |
22 } |
27 |
23 |
28 int32 AIVehicleListMaxAge::Valuate(int32 vehicle) const |
24 int32 AIVehicleListMaxAge::Valuate(int32 vehicle) const |
29 { |
25 { |
30 if (!IsValidVehicleID(vehicle)) return 0; |
26 return AIVehicle::GetMaxAge(vehicle); |
31 return GetVehicle(vehicle)->max_age; |
|
32 } |
27 } |
33 |
28 |
34 int32 AIVehicleListAgeLeft::Valuate(int32 vehicle) const |
29 int32 AIVehicleListAgeLeft::Valuate(int32 vehicle) const |
35 { |
30 { |
36 if (!IsValidVehicleID(vehicle)) return 0; |
31 return AIVehicle::GetAgeLeft(vehicle); |
37 return GetVehicle(vehicle)->max_age - GetVehicle(vehicle)->age; |
|
38 } |
32 } |
39 |
33 |
40 int32 AIVehicleListProfitThisYear::Valuate(int32 vehicle) const |
34 int32 AIVehicleListProfitThisYear::Valuate(int32 vehicle) const |
41 { |
35 { |
42 if (!IsValidVehicleID(vehicle)) return 0; |
36 return AIVehicle::GetProfitThisYear(vehicle); |
43 return GetVehicle(vehicle)->profit_this_year; |
|
44 } |
37 } |
45 |
38 |
46 int32 AIVehicleListProfitLastYear::Valuate(int32 vehicle) const |
39 int32 AIVehicleListProfitLastYear::Valuate(int32 vehicle) const |
47 { |
40 { |
48 if (!IsValidVehicleID(vehicle)) return 0; |
41 return AIVehicle::GetProfitLastYear(vehicle); |
49 return GetVehicle(vehicle)->profit_last_year; |
|
50 } |
42 } |