summaryrefslogtreecommitdiff
path: root/DSACore/Commands/CommandHandler.cs
diff options
context:
space:
mode:
authornatrixaeria <janng@gmx.de>2019-05-19 17:40:59 +0200
committernatrixaeria <janng@gmx.de>2019-05-19 17:40:59 +0200
commit1509b5ef3d7e9e71d9294e234ec0e39f2d831998 (patch)
tree78300ffff230958101b422a4e6026925b287822f /DSACore/Commands/CommandHandler.cs
parentc3bb858bb54dc8c64bbd48054c2c58dc0073f09c (diff)
parentc4d046858e0822b7c2c540ac2368b2c0e88e7a26 (diff)
Merge branch 'scribble' of https://github.com/TrueDoctor/DiscoBot into scribble
Diffstat (limited to 'DSACore/Commands/CommandHandler.cs')
-rw-r--r--DSACore/Commands/CommandHandler.cs25
1 files changed, 9 insertions, 16 deletions
diff --git a/DSACore/Commands/CommandHandler.cs b/DSACore/Commands/CommandHandler.cs
index f43633f..f74f87f 100644
--- a/DSACore/Commands/CommandHandler.cs
+++ b/DSACore/Commands/CommandHandler.cs
@@ -1,7 +1,7 @@
using System;
using DSACore.Auxiliary;
+using DSACore.Auxiliary.Calculator;
using DSACore.DSA_Game;
-using DSACore.Models;
using DSACore.Models.Network;
namespace DSACore.Commands
@@ -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":
@@ -49,28 +49,21 @@ namespace DSACore.Commands
res = RandomMisc.Roll(cmd.CmdText + " " + cmd.Cmdmodifier);
break;
case "solve":
- res = new Auxiliary.Calculator.StringSolver(cmd.CmdText + cmd.Cmdmodifier).Solve().ToString();
+ res = new StringSolver(cmd.CmdText + cmd.Cmdmodifier).Solve().ToString();
break;
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