using System; using System.Collections.Generic; namespace FiveLetters.Model { public class FiveLettersResult { public DateTime DateStart { get; } public string TaskGuid { get; } public string User { get; } public EResultGameType Result { get; set; } public List Attempts { get; set; } public FiveLettersResult(string user, string taskGuid) { Attempts = new List(); User = user; TaskGuid = taskGuid; DateStart = DateTime.Now; } internal void AddAttempt(List result) { var res = new FiveLettersItemResult(result); if (Result != EResultGameType.InProcess) { return; } Attempts.Add(res); } public HashSet GetLettersFullMatch() { HashSet fm = new HashSet(); foreach (var att in Attempts) { var attFm = att.GetLettersFullMatch(); foreach (char ch in attFm) { fm.Add(ch); } } return fm; } public HashSet GetLettersPartialMatch() { HashSet fm = new HashSet(); foreach (var att in Attempts) { var attFm = att.GetLettersPartialMatch(); foreach (char ch in attFm) { fm.Add(ch); } } return fm; } } }