From 8a6d4b06f2291c363f3dea17837ed20893852453 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Wed, 9 Sep 2015 19:00:56 +0200 Subject: Cleanup repo with some directories --- src/CmdFunctionRef.hpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/CmdFunctionRef.hpp (limited to 'src/CmdFunctionRef.hpp') diff --git a/src/CmdFunctionRef.hpp b/src/CmdFunctionRef.hpp new file mode 100644 index 0000000..f862823 --- /dev/null +++ b/src/CmdFunctionRef.hpp @@ -0,0 +1,46 @@ +#pragma once + +#include +#include +#include + +class CRSM; + +#define CMD_FUNCTION(name) void name(const QString& cmd, const QString& args, const ClientInfo& client, UserType userType) +#define CMD_FUNCTION_IMPL(name) void CRSM::name(const QString& cmd, const QString& args, const ClientInfo& client, UserType userType) { (void)cmd; (void)args; (void)client; (void)userType; + +enum UserType { + User = 0, + Admin = 1, + Moderator = 2, + Max = Moderator +}; + +typedef void (CRSM::*CmdFunction)(const QString&, const QString&, const ClientInfo&, UserType); + +const QMap 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() + { + + } +}; -- cgit v1.2.3-54-g00ecf