StationFinder Class Reference

Structure contains cached list of stations nearby. More...

#include <station_type.h>


Public Member Functions

 StationFinder (TileIndex t, int dx, int dy)
 Constructs StationFinder.
const StationListGetStations ()
 Run a tile loop to find stations around a tile, on demand.

Private Attributes

StationList stations
 List of stations nearby.
TileIndex tile
 Northern tile of producer, INVALID_TILE when # stations is valid.
int x_extent
 Width of producer.
int y_extent
 Height of producer.


Detailed Description

Structure contains cached list of stations nearby.

The list is created upon first call to GetStations()

Definition at line 142 of file station_type.h.


Constructor & Destructor Documentation

StationFinder::StationFinder ( TileIndex  t,
int  dx,
int  dy 
) [inline]

Constructs StationFinder.

Parameters:
t northern tile
dx width of producer
dy height of producer

Definition at line 154 of file station_type.h.


Member Function Documentation

const StationList * StationFinder::GetStations (  ) 

Run a tile loop to find stations around a tile, on demand.

Cache the result for further requests

Returns:
pointer to a StationList containing all stations found

Definition at line 2985 of file station_cmd.cpp.

References FindStationsAroundTiles(), INVALID_TILE, stations, x_extent, and y_extent.

Referenced by TileLoop_Town().


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

Generated on Sat Dec 26 20:06:37 2009 for OpenTTD by  doxygen 1.5.6