OpenTTD
Functions
pathfinder_func.h File Reference

General functions related to pathfinders. More...

#include "../waypoint_base.h"

Go to the source code of this file.

Functions

static TileIndex CalcClosestStationTile (StationID station, TileIndex tile, StationType station_type)
 Calculates the tile of given station that is closest to a given tile for this we assume the station is a rectangle, as defined by its tile are (st->train_station)

Detailed Description

General functions related to pathfinders.

Definition in file pathfinder_func.h.

Function Documentation

static TileIndex CalcClosestStationTile ( StationID  station,
TileIndex  tile,
StationType  station_type 
)
inlinestatic

Calculates the tile of given station that is closest to a given tile for this we assume the station is a rectangle, as defined by its tile are (st->train_station)

Parameters
stationThe station to calculate the distance to
tileThe tile from where to calculate the distance
station_typethe station type to get the closest tile of
Returns
The closest station tile to the given tile.

Definition at line 26 of file pathfinder_func.h.

References ClampU(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_station_pool >::Get(), BaseStation::GetTileArea(), OrthogonalTileArea::h, INVALID_TILE, OrthogonalTileArea::tile, TileX(), TileXY(), TileY(), OrthogonalTileArea::w, and BaseStation::xy.