From c4d046858e0822b7c2c540ac2368b2c0e88e7a26 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sun, 19 May 2019 17:00:02 +0200 Subject: general refectoring added 42 as dummy Token --- DSACore/Commands/Help.cs | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'DSACore/Commands/Help.cs') diff --git a/DSACore/Commands/Help.cs b/DSACore/Commands/Help.cs index 6458c20..974c44c 100644 --- a/DSACore/Commands/Help.cs +++ b/DSACore/Commands/Help.cs @@ -1,39 +1,18 @@ using System.Linq; -using System.Threading.Tasks; using DSACore.Auxiliary; +using DSACore.DSA_Game.Save; namespace DSACore.Commands { public class Help { - static Help() - { - /*TextReader stream = new StreamReader(@"..\..\Help.json"); // Load command-description file - var reader = new JsonTextReader(stream); // create stream reader - - reader.Read(); // step into structure, until the array starts - reader.Read(); - reader.Read(); - - try - { - var test = new JsonSerializer().Deserialize>(reader); // Deserialize Data and create CommandInfo Struct - - Commands.AddRange(test); // Add new CommandInfos to List - } - catch (Exception e) - { - // ignored - }*/ - } - //public static List Commands { get; } = new List(); public static string Get_Specific_Help(string command) { // return command specific help - var com = DSA_Game.Save.Properties.CommandInfos + var com = Properties.CommandInfos .OrderBy(x => SpellCorrect.CompareEasy(x.Name, command.ToLower())).First(); // get best fit command return com.GetDescription(); } @@ -41,7 +20,7 @@ namespace DSACore.Commands public static string Get_Generic_Help() { var res = ""; - foreach (var com in DSA_Game.Save.Properties.CommandInfos) + foreach (var com in Properties.CommandInfos) { var first_column_width = 8; res += ("!" + com.Name + ": ").AddSpaces(first_column_width) + com.Brief; -- cgit v1.2.3-70-g09d2