Data Structures | Defines | Typedefs | Functions | Variables

# station_base.h File Reference

Base classes/functions for stations. More...

`#include "core/random_func.hpp"`
`#include "base_station_base.h"`
`#include "newgrf_airport.h"`
`#include "cargopacket.h"`
`#include "industry_type.h"`
`#include "linkgraph/linkgraph_type.h"`
`#include "newgrf_storage.h"`
`#include "moving_average.h"`
`#include <map>`

Go to the source code of this file.

## Data Structures
class | LinkStat
| Link statistics. More...
class | FlowStat
| Flow statistics telling how much flow should be sent along a link. More...
struct | GoodsEntry
| Stores station stats for a single cargo. More...
struct | Airport
| All airport-related information. More...
struct | Station
| Station data structure. More...
class | AirportTileIterator
| Iterator to iterate over all tiles belonging to an airport. More...
## Defines
#define | FOR_ALL_STATIONS(var) FOR_ALL_BASE_STATIONS_OF_TYPE(Station, var)
## Typedefs
typedef Pool< BaseStation, StationID, 32, 64000 > | StationPool
typedef std::map< StationID, LinkStat > | LinkStatMap
typedef std::map< StationID, FlowStat > | FlowStatMap
| Flow descriptions by origin stations.
typedef SmallVector< Industry *, 2 > | IndustryVector
## Functions
uint | GetMovingAverageLength (const Station *from, const Station *to)
| Get the length of a moving average for a link between two stations.
## Variables
StationPool | _station_pool
| The pool of stations.
static const byte | INITIAL_STATION_RATING = 175

## Detailed Description

Base classes/functions for stations.

Definition in file station_base.h.

## Function Documentation

uint GetMovingAverageLength | ( | const Station * | from,
|  | const Station * | to |
| ) |  |  |

Get the length of a moving average for a link between two stations.

Parameters:

  | from | Source station.
  | to | Destination station.

Returns:
  Moving average length.

Definition at line 3325 of file station_cmd.cpp.

References DistanceManhattan(), LinkStat::MIN_AVERAGE_LENGTH, and BaseStation::xy.

Referenced by IncreaseStats().

## Variable Documentation

StationPool _station_pool

The pool of stations.