summaryrefslogtreecommitdiff
path: root/DSACore/Commands/NpcCommands.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/NpcCommands.cs
parentc3bb858bb54dc8c64bbd48054c2c58dc0073f09c (diff)
parentc4d046858e0822b7c2c540ac2368b2c0e88e7a26 (diff)
Merge branch 'scribble' of https://github.com/TrueDoctor/DiscoBot into scribble
Diffstat (limited to 'DSACore/Commands/NpcCommands.cs')
-rw-r--r--DSACore/Commands/NpcCommands.cs17
1 files changed, 3 insertions, 14 deletions
diff --git a/DSACore/Commands/NpcCommands.cs b/DSACore/Commands/NpcCommands.cs
index 50ea966..95243ca 100644
--- a/DSACore/Commands/NpcCommands.cs
+++ b/DSACore/Commands/NpcCommands.cs
@@ -1,27 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Threading.Tasks;
using DSACore.Characters;
using DSACore.DSA_Game;
using DSACore.DSA_Game.Characters;
-using DSACore.Auxiliary;
-using Microsoft.AspNetCore.Mvc.Internal;
namespace DSACore.Commands
{
public class NpcCommands
{
-
public static string CreateNpc(ulong id, IEnumerable<string> props, int modifier)
{
- if (int.TryParse(props.Last(), out int mean))
- {
- return Random(id, props.First(), mean, modifier);
- }
+ if (int.TryParse(props.Last(), out var mean)) return Random(id, props.First(), mean, modifier);
return Copy(id, props.First(), props.Last(), modifier);
-
}
private static string Random(ulong id, string npcName, int mean = 9, int stDv = 1)
@@ -30,13 +22,10 @@ namespace DSACore.Commands
Dsa.Chars.Add(new Npc(npcName, mean, stDv));
return $"{npcName} wurde zufällig generiert";
}
-
+
private static string Copy(ulong id, string npcName, string source, int stDv = 1)
{
- if (Dsa.Chars.Exists(x => x.Name.Equals(npcName)))
- {
- throw new Exception("Char gibt es schon");
- }
+ if (Dsa.Chars.Exists(x => x.Name.Equals(npcName))) throw new Exception("Char gibt es schon");
throw new NotImplementedException();
var chr = Dsa.GetCharacter(id);
Dsa.Chars.Add(new Character(chr as Character, npcName, stDv));