OpenTTD Source 20260206-master-g4d4e37dbf1
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
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 493 of file water_cmd.cpp.

References _current_company, CommandCost::AddCost(), BuildCanal, Canal, CheckForDockingTile(), CMD_ERROR, TileIterator::Create(), DirtyCompanyInfrastructureWindows(), Execute, EXPENSES_CONSTRUCTION, CommandCost::Failed(), CommandCost::GetCost(), GetTileOwner(), GetTileSlope(), GetTropicZone(), INVALID_TILE, IsCanal(), IsInclinedSlope(), IsTileOwner(), IsTileType(), IsValidWaterClass(), IsWaterTile(), MakeCanal(), MakeRiver(), MakeSea(), MarkCanalsAndRiversAroundDirty(), MarkTileDirtyByTile(), OWNER_NONE, River, RIVER_OFFSET_DESERT_DISTANCE, Sea, SetTropicZone(), Map::Size(), SLOPE_FLAT, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileHeight(), TROPICZONE_DESERT, TROPICZONE_NORMAL, and Water.

◆ CmdBuildLock()

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

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

◆ CmdBuildShipDepot()