diff options
author | TrueDoctor <d-kobert@web.de> | 2018-06-07 02:35:19 +0200 |
---|---|---|
committer | TrueDoctor <d-kobert@web.de> | 2018-06-07 02:35:19 +0200 |
commit | 8b2cd65526f7535ab43266653bd1146add8bd880 (patch) | |
tree | 57e0941cfab44d8720dc8f0aed5cee4e695b6176 /DiscoBot/Auxiliary | |
parent | 111b46289213b293f0977060588a90f880b3852e (diff) |
Added generic Help system
added EasyCompare as static method
Diffstat (limited to 'DiscoBot/Auxiliary')
-rw-r--r-- | DiscoBot/Auxiliary/CommandInfo.cs | 24 | ||||
-rw-r--r-- | DiscoBot/Auxiliary/SpellCorrect.cs | 9 |
2 files changed, 31 insertions, 2 deletions
diff --git a/DiscoBot/Auxiliary/CommandInfo.cs b/DiscoBot/Auxiliary/CommandInfo.cs new file mode 100644 index 0000000..b08ba1b --- /dev/null +++ b/DiscoBot/Auxiliary/CommandInfo.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DiscoBot.Auxiliary +{ + public struct CommandInfo + { + public CommandInfo(string name, string description, string scope) + { + this.Name = name; + this.Scope = scope; + this.Description = description; + } + + public string Name { get; } + + public string Scope { get; } + + public string Description { get; } + } +} diff --git a/DiscoBot/Auxiliary/SpellCorrect.cs b/DiscoBot/Auxiliary/SpellCorrect.cs index 4f4f7d0..01cce62 100644 --- a/DiscoBot/Auxiliary/SpellCorrect.cs +++ b/DiscoBot/Auxiliary/SpellCorrect.cs @@ -10,6 +10,11 @@ public override int Compare(string x, string y) { + return CompareEasy(x, y); + } + + public static int CompareEasy(string x, string y) + { if (string.IsNullOrEmpty(x)) { throw new ArgumentException("message", nameof(x)); @@ -47,7 +52,7 @@ return score + 1; } - return 100000 - (int)(this.CompareExact(x, y) * 1000.0); + return 100000 - (int)(CompareExact(x, y) * 1000.0); /*if (y.Contains(x)) return 6;*/ } @@ -63,7 +68,7 @@ throw new NotImplementedException(); } - public double CompareExact(string s, string q) + public static double CompareExact(string s, string q) { s = s.ToLower(); |