int CalcBridgeLenCostFactor(int x)
Calculate the price factor for building a long bridge.
const BridgeSpec * GetBridgeSpec(BridgeType i)
Get the specification of a bridge type.
Foundation GetBridgeFoundation(Slope tileh, Axis axis)
Get the foundation for a bridge.
constexpr uint SPRITES_PER_BRIDGE_PIECE
Number of sprites there are per bridge piece.
static const uint MAX_BRIDGES
Maximal number of available bridge specs.
bool HasBridgeFlatRamp(Slope tileh, Axis axis)
Determines if the track on a bridge ramp is flat or goes up/down.
void DrawBridgeMiddle(const TileInfo *ti, BridgePillarFlags blocked_pillars)
Draw the middle bits of a bridge.
CommandCost CheckBridgeAvailability(BridgeType bridge_type, uint bridge_len, DoCommandFlags flags={})
Is a bridge of the specified type and length available?
BridgeSpec _bridge[MAX_BRIDGES]
The specification of all bridges.
void ResetBridges()
Reset the data been eventually changed by the grf loaded.
Header file for bridge types.
static constexpr uint NUM_BRIDGE_MIDDLE_PIECES
Number of bridge middles pieces.
uint BridgeType
Bridge spec number.
Common return value for all commands.
Axis
Allow incrementing of DiagDirDiff variables.
Types related to the graphics and/or input devices.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
uint32_t PaletteID
The number of the palette.
Slope
Enumeration for the slope-type.
Foundation
Enumeration for Foundations.
#define lengthof(array)
Return the length of an fixed size array.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Struct containing information about a single bridge type.
uint16_t price
the price multiplier
ControlFlags ctrl_flags
control flags
PaletteID pal
the palette which is used in the GUI
ControlFlag
Internal flags about each BridgeSpec.
@ CustomPillarFlags
Bridge has set custom pillar flags.
@ InvalidPillarFlags
Bridge pillar flags are not valid, i.e. only the tile layout has been modified.
uint8_t min_length
the minimum length (not counting start and end tile)
BridgeMiddlePillarFlags pillar_flags
bridge pillar flags.
StringID material
the string that contains the bridge description
std::vector< std::vector< PalSpriteID > > sprite_table
table of sprites for drawing the bridge
TimerGameCalendar::Year avail_year
the year where it becomes available
StringID transport_name[2]
description of the bridge, when built for road or rail
SpriteID sprite
the sprite which is used in the GUI
uint8_t flags
bit 0 set: disable drawing of far pillars.
uint16_t speed
maximum travel speed (1 unit = 1/1.6 mph = 1 km-ish/h)
uint16_t max_length
the maximum length (not counting start and end tile)
Templated helper to make a type-safe 'typedef' representing a single POD value.
Tile information, used while rendering the tile.
Generic 'commands' that can be performed on all tiles.
Definition of the game-calendar-timer.