OpenTTD Source: src/signs_cmd.h Source File

OpenTTD Source 15.3

signs_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 SIGNS_CMD_H
11#define SIGNS_CMD_H
12
13#include "command_type.h"
14#include "signs_type.h"
15
16std::tuple<CommandCost, SignID> CmdPlaceSign(DoCommandFlags flags, TileIndex tile, const std::string &text);
17 CommandCost CmdRenameSign(DoCommandFlags flags, SignID sign_id, const std::string &text);
18 CommandCost CmdMoveSign(DoCommandFlags flags, SignID sign_id, TileIndex tile);
19
20DEF_CMD_TRAIT(CMD_PLACE_SIGN, CmdPlaceSign, CommandFlag::Deity, CommandType::OtherManagement)
21DEF_CMD_TRAIT(CMD_RENAME_SIGN, CmdRenameSign, CommandFlag::Deity, CommandType::OtherManagement)
22DEF_CMD_TRAIT(CMD_MOVE_SIGN, CmdMoveSign, CommandFlag::Deity, CommandType::OtherManagement)
23
24void CcPlaceSign(Commands cmd, const CommandCost &result, SignID new_sign);
25
26#endif /* SIGNS_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
command_type.h
Types related to commands.
CommandType::OtherManagement
@ OtherManagement
Renaming stuff, changing company colours, placing signs, etc.
CommandFlag::Deity
@ Deity
the command may be executed by COMPANY_DEITY
Commands
Commands
List of commands.
Definition command_type.h:196
CMD_PLACE_SIGN
@ CMD_PLACE_SIGN
place a sign
Definition command_type.h:282
CMD_MOVE_SIGN
@ CMD_MOVE_SIGN
move a sign
Definition command_type.h:284
CMD_RENAME_SIGN
@ CMD_RENAME_SIGN
rename a sign
Definition command_type.h:283
CmdMoveSign
CommandCost CmdMoveSign(DoCommandFlags flags, SignID sign_id, TileIndex tile)
Move a sign to the given coordinates.
Definition signs_cmd.cpp:106
CmdPlaceSign
std::tuple< CommandCost, SignID > CmdPlaceSign(DoCommandFlags flags, TileIndex tile, const std::string &text)
Place a sign at the given coordinates.
Definition signs_cmd.cpp:35
CcPlaceSign
void CcPlaceSign(Commands cmd, const CommandCost &result, SignID new_sign)
Callback function that is called after a sign is placed.
Definition signs_cmd.cpp:133
CmdRenameSign
CommandCost CmdRenameSign(DoCommandFlags flags, SignID sign_id, const std::string &text)
Rename a sign.
Definition signs_cmd.cpp:67
signs_type.h
Types related to signs.
PoolID< uint16_t, struct SignIDTag, 64000, 0xFFFF >
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >