OpenTTD Source  20241108-master-g80f628063a
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 (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
flagstype of operation
tileend tile of stretch-dragging
start_tilestart tile of stretch-dragging
wcwaterclass to build. sea and river can only be built in scenario editor
diagonalWhether to use the Orthogonal (0) or Diagonal (1) iterator.
Returns
the cost of this operation or an error

Definition at line 472 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
flagstype of operation
tiletile where to place the lock
Returns
the cost of this operation or an error

Definition at line 435 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
flagstype of operation
tiletile where ship depot is built
axisdepot orientation (Axis)
Returns
the cost of this operation or an error

Definition at line 112 of file water_cmd.cpp.

References 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 TileOffsByAxis().