diff --git a/HearthDb/Cards.cs b/HearthDb/Cards.cs index e2b98020..4ea9c49b 100644 --- a/HearthDb/Cards.cs +++ b/HearthDb/Cards.cs @@ -40,7 +40,15 @@ static Cards() public static Card GetFromName(string name, Locale lang, bool collectible = true) => (collectible ? Collectible : All).Values.FirstOrDefault(x => x.GetLocName(lang)?.Equals(name, StringComparison.InvariantCultureIgnoreCase) ?? false); - public static Card GetFromDbfId(int dbfId, bool collectibe = true) + public static List GetFromFuzzyName(string name, Locale lang, bool collectible = true) + { + var values = (collectible ? Collectible : All).Values; + var result = values.Where(x => + x.GetLocName(lang)?.IndexOf(name, StringComparison.InvariantCultureIgnoreCase) >= 0); + return result.ToList(); + } + + public static Card GetFromDbfId(int dbfId, bool collectibe = true) => (collectibe ? Collectible : All).Values.FirstOrDefault(x => x.DbfId == dbfId); } } \ No newline at end of file