summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_group.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2009-01-16 00:05:26 +0000
committertruebrain <truebrain@openttd.org>2009-01-16 00:05:26 +0000
commit94dd36d1eceb487616f9f0ea260fbe00d84cc267 (patch)
tree9e3c6b823cc8e282db94a22336d126affeaaac1c /src/ai/api/ai_group.cpp
parent5119132dda807aacb65e2afcce22665e7eedc577 (diff)
downloadopenttd-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_group.cpp')
-rw-r--r--src/ai/api/ai_group.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ai/api/ai_group.cpp b/src/ai/api/ai_group.cpp
index a6365450b..5dc676303 100644
--- a/src/ai/api/ai_group.cpp
+++ b/src/ai/api/ai_group.cpp
@@ -23,7 +23,7 @@
/* static */ AIGroup::GroupID AIGroup::CreateGroup(AIVehicle::VehicleType vehicle_type)
{
- if (!AIObject::DoCommand(0, (::VehicleType)vehicle_type, 0, CMD_CREATE_GROUP, NULL, &AIInstance::DoCommandReturnGroupID)) return INVALID_GROUP;
+ if (!AIObject::DoCommand(0, (::VehicleType)vehicle_type, 0, CMD_CREATE_GROUP, NULL, &AIInstance::DoCommandReturnGroupID)) return GROUP_INVALID;
/* In case of test-mode, we return GroupID 0 */
return (AIGroup::GroupID)0;
@@ -38,7 +38,7 @@
/* static */ AIVehicle::VehicleType AIGroup::GetVehicleType(GroupID group_id)
{
- if (!IsValidGroup(group_id)) return AIVehicle::VEHICLE_INVALID;
+ if (!IsValidGroup(group_id)) return AIVehicle::VT_INVALID;
return (AIVehicle::VehicleType)((::VehicleType)::GetGroup(group_id)->vehicle_type);
}
@@ -80,14 +80,14 @@
/* static */ int32 AIGroup::GetNumEngines(GroupID group_id, EngineID engine_id)
{
- if (!IsValidGroup(group_id) && group_id != DEFAULT_GROUP && group_id != ALL_GROUP) return -1;
+ if (!IsValidGroup(group_id) && group_id != GROUP_DEFAULT && group_id != GROUP_ALL) return -1;
return GetGroupNumEngines(_current_company, group_id, engine_id);
}
/* static */ bool AIGroup::MoveVehicle(GroupID group_id, VehicleID vehicle_id)
{
- EnforcePrecondition(false, IsValidGroup(group_id) || group_id == DEFAULT_GROUP);
+ EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_DEFAULT);
EnforcePrecondition(false, AIVehicle::IsValidVehicle(vehicle_id));
return AIObject::DoCommand(0, group_id, vehicle_id, CMD_ADD_VEHICLE_GROUP);
@@ -107,7 +107,7 @@
/* static */ bool AIGroup::SetAutoReplace(GroupID group_id, EngineID engine_id_old, EngineID engine_id_new)
{
- EnforcePrecondition(false, IsValidGroup(group_id) || group_id == ALL_GROUP);
+ EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_ALL);
EnforcePrecondition(false, AIEngine::IsValidEngine(engine_id_new));
return AIObject::DoCommand(0, 3 | (group_id << 16), (engine_id_new << 16) | engine_id_old, CMD_SET_AUTOREPLACE);
@@ -115,14 +115,14 @@
/* static */ EngineID AIGroup::GetEngineReplacement(GroupID group_id, EngineID engine_id)
{
- if (!IsValidGroup(group_id) && group_id != ALL_GROUP) return ::INVALID_ENGINE;
+ if (!IsValidGroup(group_id) && group_id != GROUP_ALL) return ::INVALID_ENGINE;
return ::EngineReplacementForCompany(GetCompany(_current_company), engine_id, group_id);
}
/* static */ bool AIGroup::StopAutoReplace(GroupID group_id, EngineID engine_id)
{
- EnforcePrecondition(false, IsValidGroup(group_id) || group_id == ALL_GROUP);
+ EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_ALL);
return AIObject::DoCommand(0, 3 | (group_id << 16), (::INVALID_ENGINE << 16) | engine_id, CMD_SET_AUTOREPLACE);
}