OpenTTD Source 20241224-master-gee860a5c8e
terraform_cmd.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
10#ifndef TERRAFORM_CMD_H
11#define TERRAFORM_CMD_H
12
13#include "command_type.h"
14#include "map_type.h"
15#include "slope_type.h"
16
17std::tuple<CommandCost, Money, TileIndex> CmdTerraformLand(DoCommandFlag flags, TileIndex tile, Slope slope, bool dir_up);
18std::tuple<CommandCost, Money, TileIndex> CmdLevelLand(DoCommandFlag flags, TileIndex tile, TileIndex start_tile, bool diagonal, LevelMode lm);
19
21DEF_CMD_TRAIT(CMD_LEVEL_LAND, CmdLevelLand, CMD_ALL_TILES | CMD_AUTO | CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) // test run might clear tiles multiple times, in execution that only happens once
22
23CommandCallback CcPlaySound_EXPLOSION;
24void CcTerraform(Commands cmd, const CommandCost &result, Money, TileIndex tile);
25
26#endif /* TERRAFORM_CMD_H */
Common return value for all commands.
Types related to commands.
void CommandCallback(Commands cmd, const CommandCost &result, TileIndex tile)
Define a callback function for the client, after the command is finished.
@ CMDT_LANDSCAPE_CONSTRUCTION
Construction and destruction of objects on the map.
DoCommandFlag
List of flags for a command.
Commands
List of commands.
@ CMD_LEVEL_LAND
level land
@ CMD_TERRAFORM_LAND
terraform a tile
@ CMD_NO_TEST
the command's output may differ between test and execute due to town rating changes etc.
@ CMD_ALL_TILES
allow this command also on MP_VOID tiles
@ CMD_AUTO
set the DC_AUTO flag on this command
Types related to maps.
LevelMode
Argument for CmdLevelLand describing what to do.
Definition map_type.h:43
Definitions of a slope.
Slope
Enumeration for the slope-type.
Definition slope_type.h:48
std::tuple< CommandCost, Money, TileIndex > CmdLevelLand(DoCommandFlag flags, TileIndex tile, TileIndex start_tile, bool diagonal, LevelMode lm)
Levels a selected (rectangle) area of land.
std::tuple< CommandCost, Money, TileIndex > CmdTerraformLand(DoCommandFlag flags, TileIndex tile, Slope slope, bool dir_up)
Terraform land.