Codechange: Pass unpacked command arguments to command callbacks (except Script).

This commit is contained in:
Michael Lutz
2021-11-28 22:43:38 +01:00
parent d85348b1d1
commit 8503854655
31 changed files with 96 additions and 75 deletions

View File

@@ -428,6 +428,20 @@ template <Commands Tcmd> struct CommandTraits;
/** Storage buffer for serialized command data. */
typedef std::vector<byte> CommandDataBuffer;
/**
* 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.
*
* @param cmd The command that was executed
* @param result The result of the executed command
* @param tile The tile of the command action
* @see CommandProc
*/
typedef void CommandCallback(Commands cmd, const CommandCost &result, TileIndex tile);
/**
* Define a callback function for the client, after the command is finished.
*
@@ -441,6 +455,6 @@ typedef std::vector<byte> CommandDataBuffer;
* @param data Additional data of the command
* @see CommandProc
*/
typedef void CommandCallback(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data);
typedef void CommandCallbackData(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data);
#endif /* COMMAND_TYPE_H */