MinchinWeb's MetaLibrary  v.9
Library functions of OpenTTD AI writers.
_MinchinWeb_Station_ Class Reference

Station. More...

Static Public Member Functions

function IsCargoAccepted (StationID, CargoID)
 Checks whether a certain Station accepts a given cargo. More...
 
function IsNextToDock (TileID)
 Checks whether a given tile is next to a dock. More...
 
function DistanceFromStation (VehicleID, StationID)
 Returns the distance between a given vehicle and a given station. More...
 

Private Attributes

 main = null
 

Detailed Description

Station.

Version
v.3 (2011-07-21)
Author
W. Minchin (MinchinWeb)
Since
MetaLibrary v.2

These are functions relating to dealing with stations.

Definition at line 38 of file Station.nut.

Member Function Documentation

function _MinchinWeb_Station_::DistanceFromStation ( VehicleID  ,
StationID   
)
static

Returns the distance between a given vehicle and a given station.

Note
Designed to be usable as a Valuator on a AIList of vehicles
Parameters
VehicleIDID of the vehicle (as an integer)
StationIDID of the station (as an integer)
Returns
Manhattan Distance between the vehicle and the station.
Todo:

Add check that supplied VehicleID and StationID are valid

Add example of valuator code

Definition at line 102 of file Station.nut.

function _MinchinWeb_Station_::IsCargoAccepted ( StationID  ,
CargoID   
)
static

Checks whether a certain Station accepts a given cargo.

Parameters
StationIDID of the station (as an integer)
CargoIDID of the cargo (as an integer)
Note
Can be used as a Valuator on a AIList of stations
Returns
Returns null if the StationID or CargoID are invalid. Returns true or false, depending on if the cargo is accepted
Todo:
Add example of valuator code

Definition at line 74 of file Station.nut.

function _MinchinWeb_Station_::IsNextToDock ( TileID  )
static

Checks whether a given tile is next to a dock.

Parameters
TileIDID of the tile (as an integer)
Returns
True if the tile is next to a dock, False otherwise.

Definition at line 89 of file Station.nut.

Member Data Documentation

_MinchinWeb_Station_::main = null
private

Definition at line 39 of file Station.nut.


The documentation for this class was generated from the following file: