public RoundKnockOutPrediction(int round, Boxer winner, PlayerPrediction playerPrediction) { Round = round; Winner = winner; Type = "RoundKnockOutPrediction"; PlayerPrediction = playerPrediction; }
public WinByPointsPrediction(Decision by, Boxer winner, PlayerPrediction playerPrediction) { By = by; Winner = winner; Type = "WinByPointsPrediction"; PlayerPrediction = playerPrediction; }
public PlayerPredictionSummary(PlayerPrediction prediction) { MatchName = string.Format("{0} vs {1}", prediction.Match.Boxers.First().FullName(), prediction.Match.Boxers.Last().FullName()); Result = prediction.Match.HasResult() ? prediction.Match.Result.ResultTextBPL() : "N/A"; MatchDate = prediction.Match.MatchDate.Value; HasOutcome = prediction.HasOutcome; Confirmed = prediction.Confirmed; Points = prediction.PointsEarned(); PredictionText = prediction.ToTextSummary(); MatchId = prediction.Match.Id; MatchCancelled = !prediction.Match.Live; }
public PlayerPrediction SetPrediction(AddPredictionInputs inputs, PlayerPrediction prediction) { if (inputs.PredictionType == "Winner") { var boxer = prediction.Match.Boxers.Single(b => b.Id == inputs.Winner); if (inputs.ByKnockOut) { prediction.WinByKnockout(boxer, inputs.Round); } if (inputs.ByPoints) { prediction.WinByPoints(boxer, inputs.Decision.Value); } } if (inputs.PredictionType == "Draw") { prediction.PredictAsDraw(); } return prediction; }
public DrawPrediction(PlayerPrediction playerPrediction) { PlayerPrediction = playerPrediction; }
public virtual PlayerPrediction CreatePrediction(Match match, DateTime createdOn) { RemoveCurrentMatchPredictions(match); var prediction = new PlayerPrediction(this, match, createdOn); return prediction; }
public virtual void AddPrediction(Week week, PlayerPrediction prediction) { week.SubmitPrediction(prediction); }
public WinnerPrediction(Boxer winner, PlayerPrediction playerPrediction) { Winner = winner; Type = "WinnerPrediction"; PlayerPrediction = playerPrediction; }
public virtual void SubmitPrediction(PlayerPrediction prediction) { Predictions.Add(prediction); prediction.Week = this; }