summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_station.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-07-31 22:30:54 +0000
committeryexo <yexo@openttd.org>2009-07-31 22:30:54 +0000
commit8c05194c0241d88226ba6c727a0c45b00d8495ed (patch)
treebe76ebd36a14a7828a9ed5400f42045b375b7c50 /src/ai/api/ai_station.cpp
parentb129184d57cac186c53bda3e8165efd63806c2aa (diff)
downloadopenttd-8c05194c0241d88226ba6c727a0c45b00d8495ed.tar.xz
(svn r17011) -Change [NoAI]: Add AIBaseStation as a parentclass for AIStation and AIWaypoint, and move GetName, SetName and GetLocation to AIBaseStation
Remove (nearly) all references to WaypointID and replace them with StationID
Diffstat (limited to 'src/ai/api/ai_station.cpp')
-rw-r--r--src/ai/api/ai_station.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/ai/api/ai_station.cpp b/src/ai/api/ai_station.cpp
index 244033f58..e2f33400a 100644
--- a/src/ai/api/ai_station.cpp
+++ b/src/ai/api/ai_station.cpp
@@ -28,34 +28,6 @@
return ::GetStationIndex(tile);
}
-/* static */ char *AIStation::GetName(StationID station_id)
-{
- if (!IsValidStation(station_id)) return NULL;
-
- static const int len = 64;
- char *station_name = MallocT<char>(len);
-
- ::SetDParam(0, Station::Get(station_id)->index);
- ::GetString(station_name, STR_STATION_NAME, &station_name[len - 1]);
- return station_name;
-}
-
-/* static */ bool AIStation::SetName(StationID station_id, const char *name)
-{
- EnforcePrecondition(false, IsValidStation(station_id));
- EnforcePrecondition(false, !::StrEmpty(name));
- EnforcePreconditionCustomError(false, ::strlen(name) < MAX_LENGTH_STATION_NAME_BYTES, AIError::ERR_PRECONDITION_STRING_TOO_LONG);
-
- return AIObject::DoCommand(0, station_id, 0, CMD_RENAME_STATION, name);
-}
-
-/* static */ TileIndex AIStation::GetLocation(StationID station_id)
-{
- if (!IsValidStation(station_id)) return INVALID_TILE;
-
- return ::Station::Get(station_id)->xy;
-}
-
/* static */ int32 AIStation::GetCargoWaiting(StationID station_id, CargoID cargo_id)
{
if (!IsValidStation(station_id)) return -1;