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/NpcCommands.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'DSACore/Commands/NpcCommands.cs') diff --git a/DSACore/Commands/NpcCommands.cs b/DSACore/Commands/NpcCommands.cs index 50ea966..9a27e6a 100644 --- a/DSACore/Commands/NpcCommands.cs +++ b/DSACore/Commands/NpcCommands.cs @@ -12,16 +12,11 @@ namespace DSACore.Commands { public class NpcCommands { - public static string CreateNpc(ulong id, IEnumerable 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 +25,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)); -- cgit v1.2.3-54-g00ecf