OpenTTD Source  20241121-master-g67a0fccfad
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 (DoCommandFlag flags, TileIndex tile_end, TileIndex tile_start, TransportType transport_type, BridgeType bridge_type, uint8_t road_rail_type)
 Build a Bridge. More...
 
CommandCost CmdBuildTunnel (DoCommandFlag flags, TileIndex start_tile, TransportType transport_type, uint8_t road_rail_type)
 Build Tunnel. More...
 
void CcBuildBridge (Commands cmd, 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. More...
 

Detailed Description

Command definitions related to tunnels and bridges.

Definition in file tunnelbridge_cmd.h.

Function Documentation

◆ CcBuildBridge()

void CcBuildBridge ( Commands  cmd,
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.

Referenced by ShowBuildBridgeWindow().

◆ CmdBuildBridge()

CommandCost CmdBuildBridge ( DoCommandFlag  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 261 of file tunnelbridge_cmd.cpp.

References _current_company, Town::cache, CalcClosestTownFromTile(), CMD_ERROR, DistanceSquare(), INVALID_RAILTYPE, INVALID_ROADTYPE, IsValidTile(), OWNER_DEITY, OWNER_TOWN, return_cmd_error, TownCache::squared_town_zone_radius, TRANSPORT_RAIL, TRANSPORT_ROAD, TRANSPORT_WATER, ValParamRailType(), ValParamRoadType(), and Town::xy.

◆ CmdBuildTunnel()

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

Build Tunnel.

Parameters
flagstype of operation
start_tilestart tile of tunnel
transport_typetransport type
road_rail_typerailtype or roadtype
Returns
the cost of this operation or an error

Definition at line 624 of file tunnelbridge_cmd.cpp.

References _build_tunnel_endtile, _current_company, Town::cache, CalcClosestTownFromTile(), CMD_ERROR, DistanceSquare(), INVALID_RAILTYPE, INVALID_ROADTYPE, OWNER_DEITY, OWNER_TOWN, TownCache::squared_town_zone_radius, TRANSPORT_RAIL, TRANSPORT_ROAD, ValParamRailType(), ValParamRoadType(), and Town::xy.