OpenTTD Source: src/terraform_cmd.h File Reference

OpenTTD Source 13.1

Functions
terraform_cmd.h File Reference
`#include "command_type.h"`
`#include "map_type.h"`
`#include "slope_type.h"`

Go to the source code of this file.

## Functions
std::tuple< CommandCost, Money, TileIndex > | CmdTerraformLand (DoCommandFlag flags, TileIndex tile, Slope slope, bool dir_up)
| Terraform land. More...
std::tuple< CommandCost, Money, TileIndex > | CmdLevelLand (DoCommandFlag flags, TileIndex tile, TileIndex start_tile, bool diagonal, LevelMode lm)
| Levels a selected (rectangle) area of land. More...
| DEF_CMD_TRAIT (CMD_LEVEL_LAND, CmdLevelLand, CMD_ALL_TILES|CMD_AUTO|CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) CommandCallback CcPlaySound_EXPLOSION
void | CcTerraform (Commands cmd, const CommandCost &result, Money, TileIndex tile)

## Detailed Description

Command definitions related to terraforming.

Definition in file terraform_cmd.h.

## Function Documentation

## ◆ CmdLevelLand()

std::tuple<CommandCost, Money, TileIndex> CmdLevelLand | ( | DoCommandFlag | flags,
|  | TileIndex | tile,
|  | TileIndex | start_tile,
|  | bool | diagonal,
|  | LevelMode | lm
| ) |  |

Levels a selected (rectangle) area of land.

Parameters

  flags | for this command type
  tile | end tile of area-drag
  start_tile | start tile of area drag
  diagonal | Whether to use the Orthogonal (false) or Diagonal (true) iterator.
  LevelMode | Mode of leveling `LevelMode`.

Returns
  the cost of this operation or an error

Definition at line 335 of file terraform_cmd.cpp.

References _current_company, _settings_game, CMD_ERROR, GameSettings::construction, EXPENSES_CONSTRUCTION, GetAvailableMoneyForCommand(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), INVALID_STRING_ID, INVALID_TILE, LM_LEVEL, LM_LOWER, LM_RAISE, ConstructionSettings::map_height_limit, MapSize(), and TileHeight().

## ◆ CmdTerraformLand()

std::tuple<CommandCost, Money, TileIndex> CmdTerraformLand | ( | DoCommandFlag | flags,
|  | TileIndex | tile,
|  | Slope | slope,
|  | bool | dir_up
| ) |  |

Terraform land.

Parameters

  flags | for this command type
  tile | tile to terraform
  slope | corners to terraform (SLOPE_xxx)
  dir_up | direction; eg up (true) or down (false)

Returns
  the cost of this operation or an error

Definition at line 186 of file terraform_cmd.cpp.

References _generating_world, _settings_game, CommandCost::AddCost(), GameSettings::construction, TerraformerState::dirty_tiles, EXPENSES_CONSTRUCTION, FindClearedObject(), ClearedObjectArea::first_tile, GetBridgeHeight(), GetSouthernBridgeEnd(), IsBridgeAbove(), IsTileType(), IsTunnelInWay(), MapSize(), ConstructionSettings::max_bridge_height, MP_VOID, SLOPE_E, SLOPE_FLAT, SLOPE_N, SLOPE_S, SLOPE_STEEP, SLOPE_W, TerraformGetHeightOfTile(), TerraformTileHeight(), TileDiffXY(), and TileHeight().