Codechange: Use lambdas instead of CommandContainer to manage station picker commands.

This commit is contained in:
Michael Lutz
2021-10-29 00:56:07 +02:00
parent a05fd7aa50
commit 996b16de70
9 changed files with 110 additions and 84 deletions

View File

@@ -460,17 +460,4 @@ template <Commands Tcmd> struct CommandTraits;
*/
typedef void CommandCallback(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text);
/**
* Structure for buffering the build command when selecting a station to join.
*/
struct CommandContainer {
TileIndex tile; ///< tile command being executed on.
uint32 p1; ///< parameter p1.
uint32 p2; ///< parameter p2.
Commands cmd; ///< command being executed.
StringID err_msg; ///< string ID of error message to use.
CommandCallback *callback; ///< any callback function executed upon successful completion of the command.
std::string text; ///< possible text sent for name changes etc.
};
#endif /* COMMAND_TYPE_H */