OpenTTD Source: src/water_cmd.h File Reference

OpenTTD Source 14.0-beta3

Functions
water_cmd.h File Reference
`#include "command_type.h"`
`#include "water_map.h"`

Go to the source code of this file.

## Functions
CommandCost | CmdBuildShipDepot (DoCommandFlag flags, TileIndex tile, Axis axis)
| Build a ship depot. More...
CommandCost | CmdBuildCanal (DoCommandFlag flags, TileIndex tile, TileIndex start_tile, WaterClass wc, bool diagonal)
| Build a piece of canal. More...
CommandCost | CmdBuildLock (DoCommandFlag flags, TileIndex tile)
| Builds a lock. More...

## Detailed Description

Command definitions related to water tiles.

Definition in file water_cmd.h.

## Function Documentation

## ◆ CmdBuildCanal()

CommandCost CmdBuildCanal | ( | DoCommandFlag | flags,
|  | TileIndex | tile,
|  | TileIndex | start_tile,
|  | WaterClass | wc,
|  | bool | diagonal
| ) |  |

Build a piece of canal.

Parameters

  flags | type of operation
  tile | end tile of stretch-dragging
  start_tile | start tile of stretch-dragging
  wc | waterclass to build. sea and river can only be built in scenario editor
  diagonal | Whether to use the Orthogonal (0) or Diagonal (1) iterator.

Returns
  the cost of this operation or an error

Definition at line 458 of file water_cmd.cpp.

References CMD_ERROR, IsValidWaterClass(), Map::Size(), and WATER_CLASS_CANAL.

## ◆ CmdBuildLock()

CommandCost CmdBuildLock | ( | DoCommandFlag | flags,
|  | TileIndex | tile
| ) |  |

Builds a lock.

Parameters

  flags | type of operation
  tile | tile where to place the lock

Returns
  the cost of this operation or an error

Definition at line 421 of file water_cmd.cpp.

References DoBuildLock(), GetInclinedSlopeDirection(), GetTileSlope(), INVALID_DIAGDIR, and return_cmd_error.

## ◆ CmdBuildShipDepot()

CommandCost CmdBuildShipDepot | ( | DoCommandFlag | flags,
|  | TileIndex | tile,
|  | Axis | axis
| ) |  |

Build a ship depot.

Parameters

  flags | type of operation
  tile | tile where ship depot is built
  axis | depot orientation (Axis)

Returns
  the cost of this operation or an error

Definition at line 101 of file water_cmd.cpp.

References AXIS_X, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_depot_pool >::CanAllocateItem(), CMD_ERROR, EXPENSES_CONSTRUCTION, GetWaterClass(), HasTileWaterGround(), IsBridgeAbove(), IsTileFlat(), IsValidAxis(), return_cmd_error, and TileDiffXY().