diff options
author | truebrain <truebrain@openttd.org> | 2009-01-16 00:05:26 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2009-01-16 00:05:26 +0000 |
commit | 94dd36d1eceb487616f9f0ea260fbe00d84cc267 (patch) | |
tree | 9e3c6b823cc8e282db94a22336d126affeaaac1c /src/ai/api/ai_vehicle.cpp | |
parent | 5119132dda807aacb65e2afcce22665e7eedc577 (diff) | |
download | openttd-94dd36d1eceb487616f9f0ea260fbe00d84cc267.tar.xz |
(svn r15101) -Change [API CHANGE]: more consistant naming for consts:
INVALID_TOWN_RATING -> TOWN_RATING_INVALID
INVALID_TRANSPORT -> TRANSPORT_INVALID
INVALID_ORDER -> ORDER_INVALID
INVALID_GROUP -> GROUP_INVALID
GROUP_ALL/DEFAULT -> ALL/DEFAULT_GROUP
VEHICLE_RAIL/ROAD/.. -> VT_RAIL/ROAD/..
MY_COMPANY -> COMPANY_SELF
FIRST/LAST/INVALID_COMPANY -> COMPANY_FIRST/LAST/INVALID
Diffstat (limited to 'src/ai/api/ai_vehicle.cpp')
-rw-r--r-- | src/ai/api/ai_vehicle.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/ai/api/ai_vehicle.cpp b/src/ai/api/ai_vehicle.cpp index 9532e3caf..7427025af 100644 --- a/src/ai/api/ai_vehicle.cpp +++ b/src/ai/api/ai_vehicle.cpp @@ -7,6 +7,7 @@ #include "ai_cargo.hpp" #include "ai_order.hpp" #include "ai_gamesettings.hpp" +#include "ai_group.hpp" #include "../ai_instance.hpp" #include "../../openttd.h" #include "../../company_func.h" @@ -323,21 +324,21 @@ /* static */ AIVehicle::VehicleType AIVehicle::GetVehicleType(VehicleID vehicle_id) { - if (!IsValidVehicle(vehicle_id)) return VEHICLE_INVALID; + if (!IsValidVehicle(vehicle_id)) return VT_INVALID; switch (::GetVehicle(vehicle_id)->type) { - case VEH_ROAD: return VEHICLE_ROAD; - case VEH_TRAIN: return VEHICLE_RAIL; - case VEH_SHIP: return VEHICLE_WATER; - case VEH_AIRCRAFT: return VEHICLE_AIR; - default: return VEHICLE_INVALID; + case VEH_ROAD: return VT_ROAD; + case VEH_TRAIN: return VT_RAIL; + case VEH_SHIP: return VT_WATER; + case VEH_AIRCRAFT: return VT_AIR; + default: return VT_INVALID; } } /* static */ AIRoad::RoadType AIVehicle::GetRoadType(VehicleID vehicle_id) { if (!IsValidVehicle(vehicle_id)) return AIRoad::ROADTYPE_INVALID; - if (GetVehicleType(vehicle_id) != VEHICLE_ROAD) return AIRoad::ROADTYPE_INVALID; + if (GetVehicleType(vehicle_id) != VT_ROAD) return AIRoad::ROADTYPE_INVALID; return (AIRoad::RoadType)::GetVehicle(vehicle_id)->u.road.roadtype; } @@ -370,7 +371,7 @@ /* static */ GroupID AIVehicle::GetGroupID(VehicleID vehicle_id) { - if (!IsValidVehicle(vehicle_id)) return ::INVALID_GROUP; + if (!IsValidVehicle(vehicle_id)) return AIGroup::GROUP_INVALID; return ::GetVehicle(vehicle_id)->group_id; } @@ -378,7 +379,7 @@ /* static */ bool AIVehicle::IsArticulated(VehicleID vehicle_id) { if (!IsValidVehicle(vehicle_id)) return false; - if (GetVehicleType(vehicle_id) != VEHICLE_ROAD && GetVehicleType(vehicle_id) != VEHICLE_RAIL) return false; + if (GetVehicleType(vehicle_id) != VT_ROAD && GetVehicleType(vehicle_id) != VT_RAIL) return false; const Vehicle *v = ::GetVehicle(vehicle_id); switch (v->type) { |