OpenTTD: src/station.cpp File Reference

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

Data Structures | Typedefs | Functions | Variables
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 "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 "roadstop_base.h"`
`#include "industry.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.

## Data Structures
struct | RectAndIndustryVector
| Rect and pointer to IndustryVector. More...

## Typedefs
typedef StationIDStack::SmallStackPool | StationIDStackPool

## Functions
static bool | FindIndustryToDeliver (TileIndex ind_tile, void *user_data)
| Callback function for Station::RecomputeIndustriesNear() Tests whether tile is an industry and possibly adds the industry to station's industries_near list.
Money | AirportMaintenanceCost (Owner owner)
| Calculates the maintenance cost of all airports of a company.

## Variables
StationPool | _station_pool ("Station")
| The pool of stations.

## Detailed Description

Implementation of the station base class.

Definition in file station.cpp.

## Function Documentation

Money AirportMaintenanceCost | ( | Owner | owner | ) |

Calculates the maintenance cost of all airports of a company.

Parameters

  owner | Company.

Returns
  Total cost.

Definition at line 558 of file station.cpp.

References Station::airport, FACIL_AIRPORT, BaseStation::facilities, Airport::GetSpec(), AirportSpec::maintenance_cost, and BaseStation::owner.

Referenced by CompaniesGenStatistics(), CompanyInfrastructureWindow::DrawWidget(), CompanyInfrastructureWindow::GetTotalMaintenanceCost(), and CompanyInfrastructureWindow::UpdateWidgetSize().

static bool FindIndustryToDeliver | ( | TileIndex | ind_tile,
|  | void * | user_data
| ) |  |
| static

Callback function for Station::RecomputeIndustriesNear() Tests whether tile is an industry and possibly adds the industry to station's industries_near list.

Parameters

  ind_tile | tile to check
  user_data | pointer to RectAndIndustryVector

Returns
  always false, we want to search all tiles

Definition at line 325 of file station.cpp.

References Industry::accepts_cargo, SmallVector< T, S >::Append(), SmallVector< T, S >::Contains(), CT_INVALID, Industry::GetByTile(), RectAndIndustryVector::industries_near, IsTileType(), lengthof, MP_INDUSTRY, RectAndIndustryVector::rect, TileX(), and TileY().

Referenced by Station::RecomputeIndustriesNear().

## Variable Documentation

StationPool _station_pool("Station")

The pool of stations.