OpenTTD Source: BridgeSpec Struct Reference

OpenTTD Source 15.3

Public Types | Data Fields
BridgeSpec Struct Reference

Struct containing information about a single bridge type. More...

`#include <bridge.h>`

## Public Types
enum class | ControlFlag : uint8_t { CustomPillarFlags , InvalidPillarFlags }
| Internal flags about each BridgeSpec. More...
using | ControlFlags = EnumBitSet< ControlFlag, uint8_t >

## Data Fields
TimerGameCalendar::Year | avail_year
| the year where it becomes available
uint8_t | min_length
| the minimum length (not counting start and end tile)
uint16_t | max_length
| the maximum length (not counting start and end tile)
uint16_t | price
| the price multiplier
uint16_t | speed
| maximum travel speed (1 unit = 1/1.6 mph = 1 km-ish/h)
SpriteID | sprite
| the sprite which is used in the GUI
PaletteID | pal
| the palette which is used in the GUI
StringID | material
| the string that contains the bridge description
StringID | transport_name [2]
| description of the bridge, when built for road or rail
std::vector< std::vector< PalSpriteID > > | sprite_table
| table of sprites for drawing the bridge
uint8_t | flags
| bit 0 set: disable drawing of far pillars.
ControlFlags | ctrl_flags {}
| control flags
BridgeMiddlePillarFlags | pillar_flags {}
| bridge pillar flags.

## Detailed Description

Struct containing information about a single bridge type.

Definition at line 27 of file bridge.h.

## Member Typedef Documentation

## ◆ ControlFlags

using BridgeSpec::ControlFlags = EnumBitSet<ControlFlag, uint8_t>

Definition at line 33 of file bridge.h.

## Member Enumeration Documentation

## ◆ ControlFlag

enum class BridgeSpec::ControlFlag : uint8_t
| strong

Internal flags about each BridgeSpec.

Enumerator
CustomPillarFlags | Bridge has set custom pillar flags.
InvalidPillarFlags | Bridge pillar flags are not valid, i.e. only the tile layout has been modified.

Definition at line 29 of file bridge.h.

## Field Documentation

## ◆ avail_year

TimerGameCalendar::Year BridgeSpec::avail_year

the year where it becomes available

Definition at line 35 of file bridge.h.

Referenced by CheckBridgeAvailability().

## ◆ ctrl_flags

ControlFlags BridgeSpec::ctrl_flags {}

control flags

Definition at line 46 of file bridge.h.

Referenced by GetBridgeTilePillarFlags().

## ◆ flags

uint8_t BridgeSpec::flags

bit 0 set: disable drawing of far pillars.

Definition at line 45 of file bridge.h.

## ◆ material

StringID BridgeSpec::material

the string that contains the bridge description

Definition at line 42 of file bridge.h.

Referenced by BuildBridgeWindow::GetBridgeSelectString().

## ◆ max_length

uint16_t BridgeSpec::max_length

the maximum length (not counting start and end tile)

Definition at line 37 of file bridge.h.

Referenced by CheckBridgeAvailability().

## ◆ min_length

uint8_t BridgeSpec::min_length

the minimum length (not counting start and end tile)

Definition at line 36 of file bridge.h.

Referenced by CheckBridgeAvailability().

## ◆ pal

PaletteID BridgeSpec::pal

the palette which is used in the GUI

Definition at line 41 of file bridge.h.

Referenced by BuildBridgeWindow::DrawWidget().

## ◆ pillar_flags

BridgeMiddlePillarFlags BridgeSpec::pillar_flags {}

bridge pillar flags.

Definition at line 47 of file bridge.h.

Referenced by GetBridgeTilePillarFlags().

## ◆ price

uint16_t BridgeSpec::price

the price multiplier

Definition at line 38 of file bridge.h.

Referenced by ShowBuildBridgeWindow().

## ◆ speed

uint16_t BridgeSpec::speed

maximum travel speed (1 unit = 1/1.6 mph = 1 km-ish/h)

Definition at line 39 of file bridge.h.

Referenced by BuildBridgeWindow::BridgeSpeedSorter(), BuildBridgeWindow::GetBridgeSelectString(), RoadVehicle::GetCurrentMaxSpeed(), Train::GetCurrentMaxSpeed(), and CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::GetSpeedLimit().

## ◆ sprite

SpriteID BridgeSpec::sprite

the sprite which is used in the GUI

Definition at line 40 of file bridge.h.

Referenced by BuildBridgeWindow::DrawWidget().

## ◆ sprite_table

std::vector<std::vector<PalSpriteID> > BridgeSpec::sprite_table

table of sprites for drawing the bridge

Definition at line 44 of file bridge.h.

Referenced by BridgeHasCustomSpriteTable(), and GetBridgeSpriteTable().

## ◆ transport_name

StringID BridgeSpec::transport_name[2]

description of the bridge, when built for road or rail

Definition at line 43 of file bridge.h.

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

- src/bridge.h