diff options
author | Dennis Kobert <d-kobert@web.de> | 2019-05-19 17:00:02 +0200 |
---|---|---|
committer | Dennis Kobert <d-kobert@web.de> | 2019-05-19 17:00:02 +0200 |
commit | c4d046858e0822b7c2c540ac2368b2c0e88e7a26 (patch) | |
tree | 8ff5cfd8646908784a45762a6148ebc150810160 /DSACore/Commands/Help.cs | |
parent | f89f308c525e9deebc6d2cf6416e27dfe1a299dc (diff) |
general refectoring
added 42 as dummy Token
Diffstat (limited to 'DSACore/Commands/Help.cs')
-rw-r--r-- | DSACore/Commands/Help.cs | 27 |
1 files changed, 3 insertions, 24 deletions
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<List<CommandInfo>>(reader); // Deserialize Data and create CommandInfo Struct - - Commands.AddRange(test); // Add new CommandInfos to List - } - catch (Exception e) - { - // ignored - }*/ - } - //public static List<CommandInfo> Commands { get; } = new List<CommandInfo>(); 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; |