OpenTTD Source 20250312-master-gcdcc6b491d
|
Types related to commands. More...
#include "company_type.h"
#include "economy_type.h"
#include "strings_type.h"
#include "tile_type.h"
Go to the source code of this file.
Data Structures | |
class | CommandCost |
Common return value for all commands. More... | |
struct | CommandFunctionTraitHelper< CommandCost(*)(DoCommandFlags, Targs...)> |
struct | CommandFunctionTraitHelper< Tret< CommandCost, Tretargs... >(*)(DoCommandFlags, Targs...)> |
Macros | |
#define | DEF_CMD_TRAIT(cmd_, proc_, flags_, type_) |
Typedefs | |
using | DoCommandFlags = EnumBitSet< DoCommandFlag, uint16_t > |
using | CommandFlags = EnumBitSet< CommandFlag, uint16_t > |
typedef std::vector< uint8_t > | CommandDataBuffer |
Storage buffer for serialized command data. | |
typedef void | CommandCallback(Commands cmd, const CommandCost &result, TileIndex tile) |
Define a callback function for the client, after the command is finished. | |
typedef void | CommandCallbackData(Commands cmd, const CommandCost &result, const CommandDataBuffer &data, CommandDataBuffer result_data) |
Define a callback function for the client, after the command is finished. | |
Functions | |
CommandCost | CommandCostWithParam (StringID str, uint64_t value) |
Return an error status, with string and parameter. | |
CommandCost | CommandCostWithParam (StringID str, ConvertibleThroughBase auto value) |
Types related to commands.
Definition in file command_type.h.
#define DEF_CMD_TRAIT | ( | cmd_, | |
proc_, | |||
flags_, | |||
type_ | |||
) |
Definition at line 463 of file command_type.h.
typedef void CommandCallback(Commands cmd, const CommandCost &result, TileIndex tile) |
Define a callback function for the client, after the command is finished.
Functions of this type are called after the command is finished. The parameters are from the #CommandProc callback type. The boolean parameter indicates if the command succeeded or failed.
cmd | The command that was executed |
result | The result of the executed command |
tile | The tile of the command action |
Definition at line 492 of file command_type.h.
typedef void CommandCallbackData(Commands cmd, const CommandCost &result, const CommandDataBuffer &data, CommandDataBuffer result_data) |
Define a callback function for the client, after the command is finished.
Functions of this type are called after the command is finished. The parameters are from the #CommandProc callback type. The boolean parameter indicates if the command succeeded or failed.
cmd | The command that was executed |
result | The result of the executed command |
tile | The tile of the command action |
data | Additional data of the command |
result_data | Additional returned data from the command |
Definition at line 508 of file command_type.h.
typedef std::vector<uint8_t> CommandDataBuffer |
Storage buffer for serialized command data.
Definition at line 478 of file command_type.h.
using CommandFlags = EnumBitSet<CommandFlag, uint16_t> |
Definition at line 418 of file command_type.h.
using DoCommandFlags = EnumBitSet<DoCommandFlag, uint16_t> |
Definition at line 397 of file command_type.h.
|
strong |
Command flags for the command table _command_proc_table.
This enumeration defines flags for the _command_proc_table.
Definition at line 404 of file command_type.h.
enum CommandPauseLevel : uint8_t |
Different command pause levels.
Definition at line 436 of file command_type.h.
enum Commands : uint8_t |
List of commands.
This enum defines all possible commands which can be executed to the game engine. Observing the game like the query-tool or checking the profit of a vehicle don't result in a command which should be executed in the engine nor send to the server in a network game.
Definition at line 197 of file command_type.h.
enum CommandType : uint8_t |
Types of commands we have.
Definition at line 421 of file command_type.h.
enum DoCommandFlag : uint8_t |
List of flags for a command.
This enums defines some flags which can be used for the commands.
Definition at line 384 of file command_type.h.
CommandCost CommandCostWithParam | ( | StringID | str, |
ConvertibleThroughBase auto | value | ||
) |
Definition at line 185 of file command_type.h.
CommandCost CommandCostWithParam | ( | StringID | str, |
uint64_t | value | ||
) |
Return an error status, with string and parameter.
str | StringID of error. |
value | Single parameter for error. |
Definition at line 418 of file command.cpp.
References GetEncodedString(), IsLocalCompany(), and CommandCost::SetEncodedMessage().
Referenced by CheckAllowRemoveRoad(), CheckforTownRating(), CheckIfAuthorityAllowsNewStation(), ClearTile_Station(), ClearTile_Town(), CmdBuildAirport(), CmdBuildBridge(), CmdDecreaseLoan(), CmdIncreaseLoan(), and CommandHelperBase::InternalExecuteProcessResult().