You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1018 B
39 lines
1018 B
using System.Collections.Generic;
|
|
|
|
namespace FiveLetters.Model
|
|
{
|
|
public class FiveLettersItemResult
|
|
{
|
|
public List<FiveLettersItemLetterResult> Results { get; set; }
|
|
|
|
public FiveLettersItemResult(List<FiveLettersItemLetterResult> results)
|
|
{
|
|
Results = results;
|
|
}
|
|
|
|
public HashSet<char> GetLettersFullMatch()
|
|
{
|
|
var hs = new HashSet<char>();
|
|
foreach(var res in Results)
|
|
{
|
|
if (res.Result == EResultLetterType.FullMatch)
|
|
{
|
|
hs.Add(res.Letter);
|
|
}
|
|
}
|
|
return hs;
|
|
}
|
|
public HashSet<char> GetLettersPartialMatch()
|
|
{
|
|
var hs = new HashSet<char>();
|
|
foreach (var res in Results)
|
|
{
|
|
if (res.Result == EResultLetterType.PartialMatch)
|
|
{
|
|
hs.Add(res.Letter);
|
|
}
|
|
}
|
|
return hs;
|
|
}
|
|
}
|
|
}
|
|
|