Exemple #1
0
 public Ranking(string playerName, IEnumerable <IClosedPrediction> predictions, ICompetitionSeason competitionSeason)
 {
     PlayerName  = playerName;
     Predictions = predictions.Count();
     foreach (var prediction in predictions)
     {
         if (prediction.Outcome == PredictionOutcome.CorrectScore)
         {
             CorrectScores++;
         }
         else if (prediction.Outcome == PredictionOutcome.CorrectOutcome)
         {
             CorrectOutcomes++;
         }
         else if (prediction.Outcome == PredictionOutcome.IncorrectOutcome)
         {
             IncorrectOutcomes++;
         }
         else if (prediction.Outcome == PredictionOutcome.NoFixtureScore)
         {
             // Nothing to append to
         }
     }
     TotalPoints  = competitionSeason.PointsFor(PredictionOutcome.CorrectScore) * CorrectScores;
     TotalPoints += competitionSeason.PointsFor(PredictionOutcome.CorrectOutcome) * CorrectOutcomes;
     TotalPoints += competitionSeason.PointsFor(PredictionOutcome.IncorrectOutcome) * IncorrectOutcomes;
 }
Exemple #2
0
 public CurrentCompetitionSeasonController(ICompetitionSeason competitionSeason)
 {
     CompetitionSeason = competitionSeason;
 }