public double ScoreCandidate(ColourfulShape candidate)
        {
            var records = _stateStore.GetRecords(candidate);

            var candidateScore = CalculateSmartLikeScore(records);

            return(candidateScore);
        }
示例#2
0
 public SmartLikeRecord[] GetRecords(ColourfulShape candidate)
 {
     return(new SmartLikeRecord[]
     {
         GetOrAdd(candidate.Colour, _colourRecords),
         GetOrAdd(candidate.Shape, _shapeRecords),
     });
 }
示例#3
0
        public void RecordDislike(ColourfulShape candidate)
        {
            SmartLikeRecord[] records = GetRecords(candidate);

            foreach (SmartLikeRecord record in records)
            {
                record.IncrementDislikes();
            }
        }
示例#4
0
        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));
        }