OpenTTD
station.cpp File Reference

Implementation of the station base class. More...

#include "stdafx.h"
#include "company_func.h"
#include "company_base.h"
#include "roadveh.h"
#include "viewport_func.h"
#include "viewport_kdtree.h"
#include "date_func.h"
#include "command_func.h"
#include "news_func.h"
#include "aircraft.h"
#include "vehiclelist.h"
#include "core/pool_func.hpp"
#include "station_base.h"
#include "station_kdtree.h"
#include "roadstop_base.h"
#include "industry.h"
#include "town.h"
#include "core/random_func.hpp"
#include "linkgraph/linkgraph.h"
#include "linkgraph/linkgraphschedule.h"
#include "table/strings.h"
#include "safeguards.h"

Go to the source code of this file.

Functions

void RebuildStationKdtree ()
 
static uint GetTileCatchmentRadius (TileIndex tile, const Station *st)
 Get the catchment size of an individual station tile. More...
 
static void AddIndustryToDeliver (Industry *ind, Station *st)
 Add nearby industry to station's industries_near list if it accepts cargo. More...
 
Money AirportMaintenanceCost (Owner owner)
 Calculates the maintenance cost of all airports of a company. More...
 

Variables

StationPool _station_pool ("Station")
 The pool of stations. More...
 
StationKdtree _station_kdtree (Kdtree_StationXYFunc)
 

Detailed Description

Implementation of the station base class.

Definition in file station.cpp.

Function Documentation

◆ AddIndustryToDeliver()

static void AddIndustryToDeliver ( Industry ind,
Station st 
)
static

Add nearby industry to station's industries_near list if it accepts cargo.

Parameters
indIndustry
stStation

Definition at line 364 of file station.cpp.

References Industry::accepts_cargo, CT_INVALID, Station::industries_near, and lengthof.

Referenced by Station::RecomputeCatchment().

◆ AirportMaintenanceCost()

Money AirportMaintenanceCost ( Owner  owner)

Calculates the maintenance cost of all airports of a company.

Parameters
ownerCompany.
Returns
Total cost.

Definition at line 653 of file station.cpp.

References FACIL_AIRPORT, BaseStation::facilities, SpecializedStation< Station, false >::Iterate(), and BaseStation::owner.

◆ GetTileCatchmentRadius()

static uint GetTileCatchmentRadius ( TileIndex  tile,
const Station st 
)
static

Get the catchment size of an individual station tile.

Parameters
tileStation tile to get catchment size of.
stAssociated station of station tile.
Precondition
IsTileType(tile, MP_STATION)
Returns
The catchment size of the station tile.

Definition at line 289 of file station.cpp.

Referenced by Station::RecomputeCatchment().

Variable Documentation

◆ _station_pool

StationPool _station_pool("Station")

The pool of stations.