summaryrefslogtreecommitdiff
path: root/DSACore/Commands/CommandHandler.cs
diff options
context:
space:
mode:
authorDennis Kobert <d-kobert@web.de>2019-05-19 16:03:38 +0200
committerDennis Kobert <d-kobert@web.de>2019-05-19 16:03:38 +0200
commitf89f308c525e9deebc6d2cf6416e27dfe1a299dc (patch)
tree7097ef871ead0245efda696198443eab8e443d3a /DSACore/Commands/CommandHandler.cs
parentf3983341be939235c1a6cd522b3bb5cc318a6d1a (diff)
Cleanup DiscoBot Project
Diffstat (limited to 'DSACore/Commands/CommandHandler.cs')
-rw-r--r--DSACore/Commands/CommandHandler.cs21
1 files changed, 7 insertions, 14 deletions
diff --git a/DSACore/Commands/CommandHandler.cs b/DSACore/Commands/CommandHandler.cs
index f43633f..6879045 100644
--- a/DSACore/Commands/CommandHandler.cs
+++ b/DSACore/Commands/CommandHandler.cs
@@ -10,8 +10,8 @@ namespace DSACore.Commands
{
public static CommandResponse ExecuteCommand(Command cmd)
{
- string res = string.Empty;
- ResponseType type = ResponseType.Broadcast;
+ var res = string.Empty;
+ var type = ResponseType.Broadcast;
switch (cmd.CmdIdentifier.ToLower())
{
case "addChar":
@@ -21,7 +21,7 @@ namespace DSACore.Commands
case "wert":
case "werte":
case "char":
- res = Commands.HeldList.ListAsync(cmd.CharId, cmd.CmdText);
+ res = HeldList.ListAsync(cmd.CharId, cmd.CmdText);
break;
case "help":
case "man":
@@ -54,23 +54,16 @@ namespace DSACore.Commands
case "npc":
res = NpcCommands.CreateNpc(cmd.CharId, cmd.CmdTexts, cmd.Cmdmodifier);
break;
-
}
- if (res == string.Empty)
- {
- res= Proben(cmd.Name, cmd.CmdIdentifier, cmd.CmdText, cmd.Cmdmodifier);
- }
- if (res != string.Empty)
- {
- return new CommandResponse(res, type);
- }
+ if (res == string.Empty) res = Proben(cmd.Name, cmd.CmdIdentifier, cmd.CmdText, cmd.Cmdmodifier);
+ if (res != string.Empty) return new CommandResponse(res, type);
return new CommandResponse($"Kommando {cmd.CmdIdentifier} nicht gefunden", ResponseType.Error);
}
private static string Proben(string name, string command, string waffe, int erschwernis = 0)
{
- string res = string.Empty;
+ var res = string.Empty;
switch (command.ToLower())
{
case "f":
@@ -138,4 +131,4 @@ namespace DSACore.Commands
throw new NotImplementedException("access char by id ore name and group id");
}
}
-}
+} \ No newline at end of file