summaryrefslogtreecommitdiff
path: root/DSACore/Commands/CommandHandler.cs
diff options
context:
space:
mode:
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