OpenTTD Source 20260206-master-g4d4e37dbf1
tunnelbridge_cmd.h File Reference

Command definitions related to tunnels and bridges. More...

#include "command_type.h"
#include "transport_type.h"
#include "bridge.h"

Go to the source code of this file.

Functions

CommandCost CmdBuildBridge (DoCommandFlags flags, TileIndex tile_end, TileIndex tile_start, TransportType transport_type, BridgeType bridge_type, uint8_t road_rail_type)
 Build a Bridge.
CommandCost CmdBuildTunnel (DoCommandFlags flags, TileIndex start_tile, TransportType transport_type, uint8_t road_rail_type)
 Build Tunnel.
void CcBuildBridge (Commands, const CommandCost &result, TileIndex end_tile, TileIndex tile_start, TransportType transport_type, BridgeType, uint8_t)
 Callback executed after a build Bridge CMD has been called.

Detailed Description

Command definitions related to tunnels and bridges.

Definition in file tunnelbridge_cmd.h.

Function Documentation

◆ CcBuildBridge()

void CcBuildBridge ( Commands ,
const CommandCost & result,
TileIndex end_tile,
TileIndex tile_start,
TransportType transport_type,
BridgeType ,
uint8_t  )

Callback executed after a build Bridge CMD has been called.

Parameters
resultWhether the build succeeded
end_tileEnd tile of the bridge.
tile_startstart tile
transport_typetransport type.

Definition at line 57 of file bridge_gui.cpp.

References _settings_client, ConnectRoadToStructure(), CommandCost::Failed(), GetTunnelBridgeDirection(), ReverseDiagDir(), SND_27_CONSTRUCTION_BRIDGE, and TRANSPORT_ROAD.

Referenced by BuildDocksToolbarWindow::OnPlaceObject(), and ShowBuildBridgeWindow().

◆ CmdBuildBridge()

CommandCost CmdBuildBridge ( DoCommandFlags flags,
TileIndex tile_end,
TileIndex tile_start,
TransportType transport_type,
BridgeType bridge_type,
uint8_t road_rail_type )

Build a Bridge.

Parameters
flagstype of operation
tile_endend tile
tile_startstart tile
transport_typetransport type.
bridge_typebridge type (hi bh)
road_rail_typerail type or road types.
Returns
the cost of this operation or an error

Definition at line 310 of file tunnelbridge_cmd.cpp.

References _current_company, _local_company, _settings_game, CommandCost::AddCost(), AddSideToSignalBuffer(), AXIS_X, AXIS_Y, AxisToDiagDir(), AxisToTrack(), BuildAqueduct, BuildBridge, Town::cache, CalcBridgeLenCostFactor(), CalcClosestTownFromTile(), ChangeTownRating(), CheckBridgeAvailability(), CheckBridgeSlope(), CheckForDockingTile(), ClearBridge, ClosestTownFromTile(), CMD_ERROR, CommandCostWithParam(), DirtyCompanyInfrastructureWindows(), DistanceSquare(), Execute, EXPENSES_CONSTRUCTION, CommandCost::Failed(), GetBridgeAxis(), GetBridgeHeight(), GetBridgeSpec(), GetBridgeType(), CommandCost::GetCost(), GetNorthernBridgeEnd(), GetOtherBridgeEnd(), GetRailType(), GetRoadOwner(), GetTileMaxZ(), GetTileOwner(), GetTileSlopeZ(), GetTileZ(), GetTunnelBridgeLength(), GetTunnelBridgeTransportType(), HasTunnelBridgeReservation(), Company::infrastructure, INVALID_DIAGDIR, INVALID_RAILTYPE, INVALID_ROADTYPE, CompanyProperties::is_ai, IsBridgeAbove(), IsBridgeTile(), IsTileOwner(), IsValidTile(), MakeAqueductBridgeRamp(), MakeRailBridgeRamp(), MakeRoadBridgeRamp(), MarkBridgeDirty(), OWNER_DEITY, OWNER_NONE, OWNER_TOWN, QueryCost, CompanyInfrastructure::rail, RailBuildCost(), RATING_TUNNEL_BRIDGE_UP_STEP, ReverseDiagDir(), CompanyInfrastructure::road, RoadBuildCost(), RTT_ROAD, RTT_TRAM, SetBridgeMiddle(), SetTunnelBridgeReservation(), SLOPE_FLAT, TownCache::squared_town_zone_radius, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileDiffXY(), TileOffsByAxis(), TileX(), TileY(), to_underlying(), TownEdge, TRANSPORT_RAIL, TRANSPORT_ROAD, TRANSPORT_WATER, TUNNELBRIDGE_TRACKBIT_FACTOR, TunnelBridgeClearCost(), ValParamRailType(), ValParamRoadType(), CompanyInfrastructure::water, Town::xy, and YapfNotifyTrackLayoutChange().

◆ CmdBuildTunnel()

CommandCost CmdBuildTunnel ( DoCommandFlags flags,
TileIndex start_tile,
TransportType transport_type,
uint8_t road_rail_type )