public double ScoreCandidate(ColourfulShape candidate) { var records = _stateStore.GetRecords(candidate); var candidateScore = CalculateSmartLikeScore(records); return(candidateScore); }
public SmartLikeRecord[] GetRecords(ColourfulShape candidate) { return(new SmartLikeRecord[] { GetOrAdd(candidate.Colour, _colourRecords), GetOrAdd(candidate.Shape, _shapeRecords), }); }
public void RecordDislike(ColourfulShape candidate) { SmartLikeRecord[] records = GetRecords(candidate); foreach (SmartLikeRecord record in records) { record.IncrementDislikes(); } }
private bool TryShowNextCandidate() { if (_candidateQueue.Count == 0) { ActiveCandidate = null; return(false); } ActiveCandidate = _candidateQueue.Dequeue(); return(true); }
public bool HasSmartLikeScore(ColourfulShape candidate) { var records = _stateStore.GetRecords(candidate); return(records.Any(HasSmartLikeScore)); }