OpenTTD Source: src/water_cmd.h File Reference

OpenTTD Source 15.0-RC2

Functions
water_cmd.h File Reference

Command definitions related to water tiles. More...

`#include "command_type.h"`
`#include "water_map.h"`

Go to the source code of this file.

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

## Detailed Description

Command definitions related to water tiles.

Definition in file water_cmd.h.

## Function Documentation

## ◆ CmdBuildCanal()

CommandCost CmdBuildCanal | ( | DoCommandFlags | 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 492 of file water_cmd.cpp.

References _current_company, CommandCost::AddCost(), Canal, CheckForDockingTile(), CMD_ERROR, TileIterator::Create(), DirtyCompanyInfrastructureWindows(), Execute, EXPENSES_CONSTRUCTION, CommandCost::Failed(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), CommandCost::GetCost(), GetTileOwner(), GetTileSlope(), GetTropicZone(), INVALID_TILE, IsCanal(), IsInclinedSlope(), IsTileOwner(), IsTileType(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::IsValidID(), IsValidWaterClass(), IsWaterTile(), MakeCanal(), MakeRiver(), MakeSea(), MarkCanalsAndRiversAroundDirty(), MarkTileDirtyByTile(), MP_WATER, OWNER_NONE, Random, River, RIVER_OFFSET_DESERT_DISTANCE, Sea, SetTropicZone(), Map::Size(), SLOPE_FLAT, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileHeight(), TROPICZONE_DESERT, and TROPICZONE_NORMAL.

## ◆ CmdBuildLock()

CommandCost CmdBuildLock | ( | DoCommandFlags | 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 453 of file water_cmd.cpp.

References _settings_game, GameSettings::construction, DoBuildLock(), ConstructionSettings::freeform_edges, GetInclinedSlopeDirection(), GetTileSlope(), INVALID_DIAGDIR, IsInsideMM(), Map::MaxX(), Map::MaxY(), ReverseDiagDir(), TileAddByDiagDir(), TileX(), and TileY().

## ◆ CmdBuildShipDepot()

CommandCost CmdBuildShipDepot | ( | DoCommandFlags | 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 112 of file water_cmd.cpp.

References _current_company, CommandCost::AddCost(), Auto, Canal, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_depot_pool >::CanAllocateItem(), CheckForDockingTile(), CMD_ERROR, DirtyCompanyInfrastructureWindows(), Execute, EXPENSES_CONSTRUCTION, CommandCost::Failed(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), CommandCost::GetCost(), GetWaterClass(), HasTileWaterClass(), HasTileWaterGround(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, IsBridgeAbove(), IsTileFlat(), IsTileOwner(), IsValidAxis(), IsWaterTile(), LOCK_DEPOT_TILE_FACTOR, MakeDefaultName(), MakeShipDepot(), MarkTileDirtyByTile(), North, South, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and TileOffsByAxis().