OpenTTD Source  20240917-master-g9ab0a47812
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 */
CmdTerraformLand
std::tuple< CommandCost, Money, TileIndex > CmdTerraformLand(DoCommandFlag flags, TileIndex tile, Slope slope, bool dir_up)
Terraform land.
Definition: terraform_cmd.cpp:181
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >
CommandCallback
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
DoCommandFlag
DoCommandFlag
List of flags for a command.
Definition: command_type.h:374
LevelMode
LevelMode
Argument for CmdLevelLand describing what to do.
Definition: map_type.h:55
CommandCost
Common return value for all commands.
Definition: command_type.h:23
CMD_AUTO
@ CMD_AUTO
set the DC_AUTO flag on this command
Definition: command_type.h:400
map_type.h
CMD_LEVEL_LAND
@ CMD_LEVEL_LAND
level land
Definition: command_type.h:322
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.
Definition: terraform_cmd.cpp:327
command_type.h
CMD_TERRAFORM_LAND
@ CMD_TERRAFORM_LAND
terraform a tile
Definition: command_type.h:198
CMD_ALL_TILES
@ CMD_ALL_TILES
allow this command also on MP_VOID tiles
Definition: command_type.h:401
Slope
Slope
Enumeration for the slope-type.
Definition: slope_type.h:48
CMD_NO_TEST
@ CMD_NO_TEST
the command's output may differ between test and execute due to town rating changes etc.
Definition: command_type.h:402
OverflowSafeInt< int64_t >
Commands
Commands
List of commands.
Definition: command_type.h:187
slope_type.h
CMDT_LANDSCAPE_CONSTRUCTION
@ CMDT_LANDSCAPE_CONSTRUCTION
Construction and destruction of objects on the map.
Definition: command_type.h:414