diff options
Diffstat (limited to 'DSACore/Commands/Help.cs')
-rw-r--r-- | DSACore/Commands/Help.cs | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/DSACore/Commands/Help.cs b/DSACore/Commands/Help.cs index 1575b36..6458c20 100644 --- a/DSACore/Commands/Help.cs +++ b/DSACore/Commands/Help.cs @@ -33,44 +33,43 @@ namespace DSACore.Commands public static string Get_Specific_Help(string command) { // return command specific help - var com = DSACore.DSA_Game.Save.Properties.CommandInfos.OrderBy(x => SpellCorrect.CompareEasy(x.Name, command.ToLower())).First(); // get best fit command + var com = DSA_Game.Save.Properties.CommandInfos + .OrderBy(x => SpellCorrect.CompareEasy(x.Name, command.ToLower())).First(); // get best fit command return com.GetDescription(); } public static string Get_Generic_Help() { - string res = ""; - foreach (var com in DSACore.DSA_Game.Save.Properties.CommandInfos) + var res = ""; + foreach (var com in DSA_Game.Save.Properties.CommandInfos) { - int first_column_width = 8; + var first_column_width = 8; res += ("!" + com.Name + ": ").AddSpaces(first_column_width) + com.Brief; if (com.Description.Length > 1) - { - res += "\n" + "".AddSpaces(first_column_width) + "(\"!man " + com.Name + "\" gibt genauere Informationen)"; - } + res += "\n" + "".AddSpaces(first_column_width) + "(\"!man " + com.Name + + "\" gibt genauere Informationen)"; res += "\n\n"; } + return res; } - + public static string ShowHelp(params string[] commandList) { var command = ""; - if (commandList.Length > 0) { - command = commandList.Aggregate((s, c) => s + " " + c); - } + if (commandList.Length > 0) command = commandList.Aggregate((s, c) => s + " " + c); if (command.Equals(string.Empty)) // return generic Help { - string res = Get_Generic_Help(); - + var res = Get_Generic_Help(); + return res; } - + return Get_Specific_Help(command); } } -} +}
\ No newline at end of file |