OpenTTD Source: src/tunnelbridge_cmd.h File Reference

OpenTTD Source 14.0-beta1

Functions
tunnelbridge_cmd.h File Reference
`#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, byte road_rail_type)
| Build a Bridge. More...
CommandCost | CmdBuildTunnel (DoCommandFlag flags, TileIndex start_tile, TransportType transport_type, byte road_rail_type)
| Build Tunnel. More...
void | CcBuildBridge (Commands cmd, const CommandCost &result, TileIndex end_tile, TileIndex tile_start, TransportType transport_type, BridgeType, byte)
| 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 | ,
|  | const CommandCost & | result,
|  | TileIndex | end_tile,
|  | TileIndex | tile_start,
|  | TransportType | transport_type,
|  | BridgeType | ,
|  | byte |
| ) |  |

Callback executed after a build Bridge CMD has been called.

Parameters

  result | Whether the build succeeded
  end_tile | End tile of the bridge.
  tile_start | start tile
  transport_type | transport 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,
|  | byte | road_rail_type
| ) |  |

Build a Bridge.

Parameters

  flags | type of operation
  tile_end | end tile
  tile_start | start tile
  transport_type | transport type.
  bridge_type | bridge type (hi bh)
  road_rail_type | rail 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,
|  | byte | road_rail_type
| ) |  |

Build Tunnel.

Parameters

  flags | type of operation
  start_tile | start tile of tunnel
  transport_type | transport type
  road_rail_type | railtype or roadtype

Returns
  the cost of this operation or an error

Definition at line 625 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.