diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-10-05 22:02:27 +0200 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-12-16 22:28:32 +0100 |
commit | 33ca4f2b9950d98fed902962c847833667ccca9f (patch) | |
tree | 503825bff107d7a296c4bf7a0c6e64bd957e0454 /src/command_func.h | |
parent | 5ddfdc8516e35c4f5de2613692d104486151171b (diff) | |
download | openttd-33ca4f2b9950d98fed902962c847833667ccca9f.tar.xz |
Codechange: Let the compile generate the master command table out of templated command traits.
This is using a non-intrusive type-traits like templated system, which
allows compile-time validation that the command table and the command
enum match up.
Diffstat (limited to 'src/command_func.h')
-rw-r--r-- | src/command_func.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/command_func.h b/src/command_func.h index 662ae00a5..15c88ea03 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -47,11 +47,11 @@ void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *cal extern Money _additional_cash_required; -bool IsValidCommand(uint32 cmd); +bool IsValidCommand(Commands cmd); CommandFlags GetCommandFlags(Commands cmd); const char *GetCommandName(Commands cmd); Money GetAvailableMoneyForCommand(); -bool IsCommandAllowedWhilePaused(uint32 cmd); +bool IsCommandAllowedWhilePaused(Commands cmd); /** * Extracts the DC flags needed for DoCommand from the flags returned by GetCommandFlags |