OpenTTD Source: StationSpec Struct Reference

OpenTTD Source 15.0-beta1

Public Types | Data Fields
StationSpec Struct Reference

Station specification. More...

`#include <newgrf_station.h>`

Inheritance diagram for StationSpec:

## Public Types
enum class | TileFlags : uint8_t { None = 0 , Pylons = 1U << 0 , NoWires = 1U << 1 , Blocked = 1U << 2 }

## Data Fields
GRFFilePropsBase< NUM_CARGO+3 > | grf_prop
| Properties related the the grf file.
StringID | name
| Name of this station.
uint8_t | disallowed_platforms
| Bitmask of number of platforms available for the station.
uint8_t | disallowed_lengths
| Bitmask of platform lengths available for the station.
std::vector< NewGRFSpriteLayout > | renderdata
| Number of tile layouts.
uint16_t | cargo_threshold
| Cargo threshold for choosing between little and lots of cargo.
CargoTypes | cargo_triggers
| Bitmask of cargo types which cause trigger re-randomizing.
uint8_t | callback_mask
| Bitmask of station callbacks that have to be called.
uint8_t | flags
| Bitmask of flags, bit 0: use different sprite set; bit 1: divide cargo about by station size.
std::vector< TileFlags > | tileflags
| List of tile flags.
AnimationInfo | animation
std::unordered_map< uint16_t, std::vector< uint8_t > > | layouts
| Custom platform layouts, keyed by platform and length combined.
Data Fields inherited from NewGRFSpecBase< StationClassID >
StationClassID | class_index
| Class index of this spec, invalid until class is allocated.
uint16_t | index
| Index within class of this spec, invalid until inserted into class.

## Detailed Description

Station specification.

Definition at line 115 of file newgrf_station.h.

## Member Enumeration Documentation

## ◆ TileFlags

enum class StationSpec::TileFlags : uint8_t
| strong

Enumerator
Pylons | Tile should contain catenary pylons.
NoWires | Tile should NOT contain catenary wires.
Blocked | Tile is blocked to vehicles.

Definition at line 163 of file newgrf_station.h.

## Constructor & Destructor Documentation

## ◆ StationSpec()

StationSpec::StationSpec | ( |  | ) |
| inline

Definition at line 116 of file newgrf_station.h.

## Field Documentation

## ◆ animation

AnimationInfo StationSpec::animation

Definition at line 171 of file newgrf_station.h.

## ◆ callback_mask

uint8_t StationSpec::callback_mask

Bitmask of station callbacks that have to be called.

Definition at line 159 of file newgrf_station.h.

Referenced by CheckFlatLandRailStation(), CmdBuildRailStation(), DrawStationTile(), and IsStationAvailable().

## ◆ cargo_threshold

uint16_t StationSpec::cargo_threshold

Cargo threshold for choosing between little and lots of cargo.

Note
  little/lots are equivalent to the moving/loading states for vehicles

Definition at line 155 of file newgrf_station.h.

Referenced by StationResolverObject::ResolveReal().

## ◆ cargo_triggers

CargoTypes StationSpec::cargo_triggers

Bitmask of cargo types which cause trigger re-randomizing.

Definition at line 157 of file newgrf_station.h.

Referenced by StationChangeInfo(), and TriggerStationRandomisation().

## ◆ disallowed_lengths

uint8_t StationSpec::disallowed_lengths

Bitmask of platform lengths available for the station.

0..6 correspond to 1..7, while bit 7 corresponds to >7 tiles long.

Definition at line 139 of file newgrf_station.h.

Referenced by BuildRailStationWindow::CheckSelectedSize(), CmdBuildRailStation(), BuildRailStationWindow::OnClick(), and BuildRailStationWindow::OnPaint().

## ◆ disallowed_platforms

uint8_t StationSpec::disallowed_platforms

Bitmask of number of platforms available for the station.

0..6 correspond to 1..7, while bit 7 corresponds to >7 platforms.

Definition at line 134 of file newgrf_station.h.

Referenced by BuildRailStationWindow::CheckSelectedSize(), CmdBuildRailStation(), BuildRailStationWindow::OnClick(), and BuildRailStationWindow::OnPaint().

## ◆ flags

uint8_t StationSpec::flags

Bitmask of flags, bit 0: use different sprite set; bit 1: divide cargo about by station size.

Definition at line 161 of file newgrf_station.h.

Referenced by DrawStationTile(), and StationResolverObject::ResolveReal().

## ◆ grf_prop

GRFFilePropsBase<NUM_CARGO + 3> StationSpec::grf_prop

Properties related the the grf file.

NUM_CARGO real cargo plus three pseudo cargo sprite groups. Used for obtaining the sprite offset of custom sprites, and for evaluating callbacks.

Definition at line 127 of file newgrf_station.h.

Referenced by AllocateSpecToStation(), CmdBuildRailStation(), StationResolverObject::GetDebugID(), NIHStation::GetGRFID(), StationScopeResolver::GetVariable(), IsStationAvailable(), MoveWaypointsToBaseStations(), PerformStationTileSlopeCheck(), and StationResolverObject::StationResolverObject().

## ◆ layouts

std::unordered_map<uint16_t, std::vector<uint8_t> > StationSpec::layouts

Custom platform layouts, keyed by platform and length combined.

Definition at line 174 of file newgrf_station.h.

Referenced by GetStationLayout(), and StationChangeInfo().

## ◆ name

StringID StationSpec::name

Name of this station.

Definition at line 128 of file newgrf_station.h.

## ◆ renderdata

std::vector<NewGRFSpriteLayout> StationSpec::renderdata

Number of tile layouts.

A minimum of 8 is required is required for stations. 0-1 = plain platform 2-3 = platform with building 4-5 = platform with roof, left side 6-7 = platform with roof, right side Array of tile layouts.

Definition at line 149 of file newgrf_station.h.

Referenced by DrawStationTile(), and StationChangeInfo().

## ◆ tileflags

std::vector<TileFlags> StationSpec::tileflags

List of tile flags.

Definition at line 169 of file newgrf_station.h.

Referenced by GetStationTileFlags().

The documentation for this struct was generated from the following file:

- src/newgrf_station.h