OpenTTD Source: src/terraform_cmd.h Source File

OpenTTD Source 15.0-RC2

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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
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(DoCommandFlags flags, TileIndex tile, Slope slope, bool dir_up);
18std::tuple<CommandCost, Money, TileIndex> CmdLevelLand(DoCommandFlags flags, TileIndex tile, TileIndex start_tile, bool diagonal, LevelMode lm);
19
20DEF_CMD_TRAIT(CMD_TERRAFORM_LAND, CmdTerraformLand, CommandFlags({CommandFlag::AllTiles, CommandFlag::Auto}), CommandType::LandscapeConstruction)
21DEF_CMD_TRAIT(CMD_LEVEL_LAND, CmdLevelLand, CommandFlags({CommandFlag::AllTiles, CommandFlag::Auto, CommandFlag::NoTest}), CommandType::LandscapeConstruction) // test run might clear tiles multiple times, in execution that only happens once
22
23 CommandCallback CcPlaySound_EXPLOSION;
24void CcTerraform(Commands cmd, const CommandCost &result, Money, TileIndex tile);
25
26#endif /* TERRAFORM_CMD_H */
CommandCost
Common return value for all commands.
Definition command_type.h:24
EnumBitSet
Enum-as-bit-set wrapper.
Definition enum_type.hpp:177
OverflowSafeInt< int64_t >
command_type.h
Types related to commands.
CommandType::LandscapeConstruction
@ LandscapeConstruction
Construction and destruction of objects on the map.
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:495
CommandFlag::Auto
@ Auto
set the DoCommandFlag::Auto flag on this command
CommandFlag::AllTiles
@ AllTiles
allow this command also on MP_VOID tiles
CommandFlag::NoTest
@ NoTest
the command's output may differ between test and execute due to town rating changes etc.
Commands
Commands
List of commands.
Definition command_type.h:196
CMD_LEVEL_LAND
@ CMD_LEVEL_LAND
level land
Definition command_type.h:334
CMD_TERRAFORM_LAND
@ CMD_TERRAFORM_LAND
terraform a tile
Definition command_type.h:207
map_type.h
Types related to maps.
LevelMode
LevelMode
Argument for CmdLevelLand describing what to do.
Definition map_type.h:43
slope_type.h
Definitions of a slope.
Slope
Slope
Enumeration for the slope-type.
Definition slope_type.h:48
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >
CmdLevelLand
std::tuple< CommandCost, Money, TileIndex > CmdLevelLand(DoCommandFlags flags, TileIndex tile, TileIndex start_tile, bool diagonal, LevelMode lm)
Levels a selected (rectangle) area of land.
Definition terraform_cmd.cpp:315
CmdTerraformLand
std::tuple< CommandCost, Money, TileIndex > CmdTerraformLand(DoCommandFlags flags, TileIndex tile, Slope slope, bool dir_up)
Terraform land.
Definition terraform_cmd.cpp:169