summaryrefslogtreecommitdiff
path: root/src/command_type.h
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-10-31 22:07:22 +0100
committerMichael Lutz <michi@icosahedron.de>2021-12-16 22:28:32 +0100
commiteab18f06a47e558fe313cb86c855e8949b01feed (patch)
treea6dd29dc2ea3eb44ea2432151fa392ccd31c7d73 /src/command_type.h
parent0f64ee5ce1548d9cda69917f27c5b1a3cb91823d (diff)
downloadopenttd-eab18f06a47e558fe313cb86c855e8949b01feed.tar.xz
Codechange: Pass additional data as byte stream to command callbacks.
Diffstat (limited to 'src/command_type.h')
-rw-r--r--src/command_type.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/command_type.h b/src/command_type.h
index c182ca393..59331dc7c 100644
--- a/src/command_type.h
+++ b/src/command_type.h
@@ -13,6 +13,7 @@
#include "economy_type.h"
#include "strings_type.h"
#include "tile_type.h"
+#include <vector>
struct GRFFile;
@@ -444,6 +445,9 @@ template <Commands Tcmd> struct CommandTraits;
static inline constexpr const char *name = #proc_; \
};
+/** Storage buffer for serialized command data. */
+typedef std::vector<byte> CommandDataBuffer;
+
/**
* Define a callback function for the client, after the command is finished.
*
@@ -451,14 +455,12 @@ template <Commands Tcmd> struct CommandTraits;
* are from the #CommandProc callback type. The boolean parameter indicates if the
* command succeeded or failed.
*
- * @param result The result of the executed command
* @param cmd The command that was executed
+ * @param result The result of the executed command
* @param tile The tile of the command action
- * @param p1 Additional data of the command
- * @param p1 Additional data of the command
- * @param text Text of the command
+ * @param data Additional data of the command
* @see CommandProc
*/
-typedef void CommandCallback(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text);
+typedef void CommandCallback(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data);
#endif /* COMMAND_TYPE_H */