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...

main = null

## Detailed Description

Station.

Version
v.3 (2011-07-21)
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
 VehicleID ID of the vehicle (as an integer) StationID ID 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

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
 StationID ID of the station (as an integer) CargoID ID 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:

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
 TileID ID 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: