OpenTTD Source  20241108-master-g80f628063a
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 
17 std::tuple<CommandCost, Money, TileIndex> CmdTerraformLand(DoCommandFlag flags, TileIndex tile, Slope slope, bool dir_up);
18 std::tuple<CommandCost, Money, TileIndex> CmdLevelLand(DoCommandFlag flags, TileIndex tile, TileIndex start_tile, bool diagonal, LevelMode lm);
19 
21 DEF_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 
23 CommandCallback CcPlaySound_EXPLOSION;
24 void CcTerraform(Commands cmd, const CommandCost &result, Money, TileIndex tile);
25 
26 #endif /* TERRAFORM_CMD_H */
Common return value for all commands.
Definition: command_type.h:23
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.
Definition: command_type.h:484
@ CMDT_LANDSCAPE_CONSTRUCTION
Construction and destruction of objects on the map.
Definition: command_type.h:414
DoCommandFlag
List of flags for a command.
Definition: command_type.h:374
Commands
List of commands.
Definition: command_type.h:187
@ CMD_LEVEL_LAND
level land
Definition: command_type.h:322
@ CMD_TERRAFORM_LAND
terraform a tile
Definition: command_type.h:198
@ CMD_NO_TEST
the command's output may differ between test and execute due to town rating changes etc.
Definition: command_type.h:402
@ CMD_ALL_TILES
allow this command also on MP_VOID tiles
Definition: command_type.h:401
@ CMD_AUTO
set the DC_AUTO flag on this command
Definition: command_type.h:400
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.