AIBaseStation Class Reference

Base class for stations and waypoints. More...

Inheritance diagram for AIBaseStation:

AIStation AIWaypoint

Public Types

enum  SpecialStationIDs {
  STATION_NEW,
  STATION_JOIN_ADJACENT,
  STATION_INVALID
}
 Special station IDs for building adjacent/new stations when the adjacent/distant join features are enabled. More...

Static Public Member Functions

static bool IsValidBaseStation (StationID station_id)
 Checks whether the given basestation is valid and owned by you.
static char * GetName (StationID station_id)
 Get the name of a basestation.
static bool SetName (StationID station_id, Text *name)
 Set the name this basestation.
static TileIndex GetLocation (StationID station_id)
 Get the current location of a basestation.
static int32 GetConstructionDate (StationID station_id)
 Get the last date a station part was added to this station.

Detailed Description

Base class for stations and waypoints.

Member Enumeration Documentation

Special station IDs for building adjacent/new stations when the adjacent/distant join features are enabled.

Enumerator:
STATION_NEW  Build a new station.
STATION_JOIN_ADJACENT  Join an neighbouring station if one exists.
STATION_INVALID  Invalid station id.


Member Function Documentation

static bool AIBaseStation::IsValidBaseStation ( StationID  station_id  )  [static]

Checks whether the given basestation is valid and owned by you.

Parameters:
station_id The station to check.
Returns:
True if and only if the basestation is valid.
Note:
IsValidBaseStation == (IsValidStation || IsValidWaypoint).

static char* AIBaseStation::GetName ( StationID  station_id  )  [static]

Get the name of a basestation.

Parameters:
station_id The basestation to get the name of.
Precondition:
IsValidBaseStation(station_id).
Returns:
The name of the station.

static bool AIBaseStation::SetName ( StationID  station_id,
Text *  name 
) [static]

Set the name this basestation.

Parameters:
station_id The basestation to set the name of.
name The new name of the station (can be either a raw string, or a AIText object).
Precondition:
IsValidBaseStation(station_id).

name != NULL && len(name) != 0.

Exceptions:
AIError::ERR_NAME_IS_NOT_UNIQUE 
Returns:
True if the name was changed.

static TileIndex AIBaseStation::GetLocation ( StationID  station_id  )  [static]

Get the current location of a basestation.

Parameters:
station_id The basestation to get the location of.
Precondition:
IsValidBaseStation(station_id).
Returns:
The tile the basestation sign above it.
Note:
The tile is not necessarily a station tile (and if it is, it could also belong to another station).
See also:
AITileList_StationType.

static int32 AIBaseStation::GetConstructionDate ( StationID  station_id  )  [static]

Get the last date a station part was added to this station.

Parameters:
station_id The station to look at.
Returns:
The last date some part of this station was build.


Generated on Thu May 31 21:43:01 2012 for OpenTTD NoAI API by  doxygen 1.5.6