OpenTTD
|
Types related to commands. More...
Go to the source code of this file.
Data Structures | |
class | CommandCost |
Common return value for all commands. More... | |
struct | Command |
Define a command with the flags which belongs to it. More... | |
struct | CommandContainer |
Structure for buffering the build command when selecting a station to join. More... |
Macros | |
#define | CMD_MSG(x) ((x) << 16) |
Used to combine a StringID with the command. |
Typedefs | |
typedef CommandCost | CommandProc (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) |
Defines the callback type for all command handler functions. | |
typedef void | CommandCallback (const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) |
Define a callback function for the client, after the command is finished. |
Types related to commands.
Definition in file command_type.h.
#define CMD_MSG | ( | x | ) | ((x) << 16) |
Used to combine a StringID with the command.
This macro can be used to add a StringID (the error message to show) on a command-id (CMD_xxx). Use the binary or-operator "|" to combine the command with the result from this macro.
x | The StringID to combine with a command-id |
Definition at line 366 of file command_type.h.
Referenced by ChangeTimetableStartCallback(), CommonRaiseLowerBigLand(), GenericPlaceSignals(), GUIPlaceProcDragXY(), HandleAutoSignalPlacement(), TownAuthorityWindow::OnClick(), TownViewWindow::OnClick(), CompanyFinancesWindow::OnClick(), BuildIndustryWindow::OnClick(), TimetableWindow::OnClick(), VehicleGroupWindow::OnClick(), OrdersWindow::OnClick(), VehicleDetailsWindow::OnClick(), CompanyWindow::OnClick(), BuyCompanyWindow::OnClick(), VehicleViewWindow::OnClick(), DepotWindow::OnDragDrop(), OrdersWindow::OnDragDrop(), VehicleGroupWindow::OnDropdownSelect(), OrdersWindow::OnDropdownSelect(), VehicleDetailsWindow::OnDropdownSelect(), BuildTreesWindow::OnPlaceMouseUp(), BuildDocksToolbarWindow::OnPlaceMouseUp(), BuildRoadToolbarWindow::OnPlaceMouseUp(), BuildRailToolbarWindow::OnPlaceMouseUp(), BuildDocksToolbarWindow::OnPlaceObject(), TerraformToolbarWindow::OnPlaceObject(), BuildObjectWindow::OnPlaceObject(), BuildRoadToolbarWindow::OnPlaceObject(), BuildIndustryWindow::OnPlaceObject(), BuildRailToolbarWindow::OnPlaceObject(), OrdersWindow::OnPlaceObject(), CompanyWindow::OnPlaceObject(), WaypointWindow::OnQueryTextFinished(), TownViewWindow::OnQueryTextFinished(), TimetableWindow::OnQueryTextFinished(), VehicleGroupWindow::OnQueryTextFinished(), DepotWindow::OnQueryTextFinished(), OrdersWindow::OnQueryTextFinished(), BuildVehicleWindow::OnQueryTextFinished(), StationViewWindow::OnQueryTextFinished(), VehicleDetailsWindow::OnQueryTextFinished(), CompanyWindow::OnQueryTextFinished(), DepotWindow::OnVehicleSelect(), OrdersWindow::OrderClick_Delete(), OrdersWindow::OrderClick_FullLoad(), OrdersWindow::OrderClick_NearestDepot(), OrdersWindow::OrderClick_Nonstop(), OrdersWindow::OrderClick_Service(), OrdersWindow::OrderClick_Skip(), OrdersWindow::OrderClick_StopSharing(), OrdersWindow::OrderClick_Unload(), PlaceAirport(), PlaceProc_Sign(), PlaceRail_Station(), PlaceRail_Waypoint(), RenameSign(), and ShowBuildBridgeWindow().
typedef void CommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) |
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.
result | The result of the executed command |
tile | The tile of the command action |
p1 | Additional data of the command |
p1 | Additional data of the command |
Definition at line 467 of file command_type.h.
typedef CommandCost CommandProc(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) |
Defines the callback type for all command handler functions.
This type defines the function header for all functions which handles a CMD_* command. A command handler use the parameters to act according to the meaning of the command. The tile parameter defines the tile to perform an action on. The flag parameter is filled with flags from the DC_* enumeration. The parameters p1 and p2 are filled with parameters for the command like "which road type", "which order" or "direction". Each function should mentioned in there doxygen comments the usage of these parameters.
tile | The tile to apply a command on |
flags | Flags for the command, from the DC_* enumeration |
p1 | Additional data for the command |
p2 | Additional data for the command |
text | Additional text |
Definition at line 439 of file command_type.h.
enum CommandFlags |
Command flags for the command table _command_proc_table.
This enumeration defines flags for the _command_proc_table.
Definition at line 384 of file command_type.h.
enum CommandPauseLevel |
Different command pause levels.
Definition at line 414 of file command_type.h.
enum Commands |
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 177 of file command_type.h.
enum CommandType |
Types of commands we have.
Definition at line 399 of file command_type.h.
enum DoCommandFlag |
List of flags for a command.
This enums defines some flags which can be used for the commands.
Definition at line 340 of file command_type.h.
enum FlaggedCommands |
Defines some flags.
This enumeration defines some flags which are binary-or'ed on a command.
CMD_NETWORK_COMMAND |
execute the command without sending it on the network |
CMD_FLAGS_MASK |
mask for all command flags |
CMD_ID_MASK |
mask for the command ID |
Definition at line 373 of file command_type.h.