From f89f308c525e9deebc6d2cf6416e27dfe1a299dc Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sun, 19 May 2019 16:03:38 +0200 Subject: Cleanup DiscoBot Project --- DSACore/Commands/CommandHandler.cs | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'DSACore/Commands/CommandHandler.cs') 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 -- cgit v1.2.3-54-g00ecf