diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2015-01-04 13:57:11 +0100 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2015-01-04 13:57:11 +0100 |
| commit | fbe3c5fbe1327fd81e2eb8fe30a75c4cf5d7b35c (patch) | |
| tree | 02c7bd3f23e18ffcd2d75257ab215e87ead72c96 /CmdFunctionRef.hpp | |
| parent | a92aea252411f86657081587633a88083a3b14a9 (diff) | |
| download | manager-fbe3c5fbe1327fd81e2eb8fe30a75c4cf5d7b35c.tar.gz manager-fbe3c5fbe1327fd81e2eb8fe30a75c4cf5d7b35c.zip | |
Cleanup completed. New Interface based system.
Diffstat (limited to 'CmdFunctionRef.hpp')
| -rw-r--r-- | CmdFunctionRef.hpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/CmdFunctionRef.hpp b/CmdFunctionRef.hpp new file mode 100644 index 0000000..586090a --- /dev/null +++ b/CmdFunctionRef.hpp @@ -0,0 +1,45 @@ +#pragma once + +#include <QString> +#include <QMap> +#include <ClientInfo.hpp> + +class CRSM; + +#define CMD_FUNCTION(name) void name(const QString& cmd, const QString& args, const ClientInfo& client, UserType userTypeModerator) +#define CMD_FUNCTION_IMPL(name) void CRSM::name(const QString& cmd, const QString& args, const ClientInfo& client, UserType userType) + +enum UserType { + User = 0, + Admin = 1, + Moderator = 2 +}; + +typedef void (CRSM::*CmdFunction)(const QString&, const QString&, const ClientInfo&, UserType); + +const QMap<UserType, QString> userTypeStrings { + {User, "Benutzer"}, + {Admin, "Rundenadmin oder Moderator"}, + {Moderator, "Moderator"} +}; + +struct CmdFunctionRef +{ + CmdFunction func = nullptr; + int interfaces = Clonk | IRC; + UserType userType = User; + QString shortDescription = ""; + QString longDescription = ""; + QString name = ""; + QString argList = ""; + + CmdFunctionRef(QString name, CmdFunction func, int interfaces, UserType userType, const QString& shortDescription = "", QString argList = "", const QString &longDescription = "") : func(func), interfaces(interfaces), userType(userType), shortDescription(shortDescription), longDescription(longDescription), name(name), argList(argList) + { + + } + + CmdFunctionRef() + { + + } +}; |
