예제 #1
0
 public RoundKnockOutPrediction(int round, Boxer winner, PlayerPrediction playerPrediction)
 {
     Round = round;
     Winner = winner;
     Type = "RoundKnockOutPrediction";
     PlayerPrediction = playerPrediction;
 }
예제 #2
0
 public WinByPointsPrediction(Decision by, Boxer winner, PlayerPrediction playerPrediction)
 {
     By = by;
     Winner = winner;
     Type = "WinByPointsPrediction";
     PlayerPrediction = playerPrediction;
 }
예제 #3
0
        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;
        }
예제 #4
0
        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;
        }
예제 #5
0
 public DrawPrediction(PlayerPrediction playerPrediction)
 {
     PlayerPrediction = playerPrediction;
 }
예제 #6
0
파일: Player.cs 프로젝트: elmo61/BritBoxing
 public virtual PlayerPrediction CreatePrediction(Match match, DateTime createdOn)
 {
     RemoveCurrentMatchPredictions(match);
     var prediction = new PlayerPrediction(this, match, createdOn);
     return prediction;
 }
예제 #7
0
파일: League.cs 프로젝트: elmo61/BritBoxing
 public virtual void AddPrediction(Week week, PlayerPrediction prediction)
 {
     week.SubmitPrediction(prediction);
 }
예제 #8
0
 public WinnerPrediction(Boxer winner, PlayerPrediction playerPrediction)
 {
     Winner = winner;
     Type = "WinnerPrediction";
     PlayerPrediction = playerPrediction;
 }
예제 #9
0
파일: Week.cs 프로젝트: elmo61/BritBoxing
 public virtual void SubmitPrediction(PlayerPrediction prediction)
 {
     Predictions.Add(prediction);
     prediction.Week = this;
 }