Ejemplo n.º 1
0
        public PlayerProfileResult(player p, result r)
        {
            this.PriorHandicapForPlayer = r.priorHandicap;
            this.Points          = r.points;
            this.WasWin          = r.WasWin();
            this.WasLoss         = r.WasLoss();
            this.ScoreDifference = r.ScoreDifference();
            this.Score           = r.score;

            var opponentResult = r.OpponentResult();

            if (opponentResult == null)
            {
                foreach (team aTeam in r.match.teammatchup.teams)
                {
                    if (r.team.id != aTeam.id)
                    {
                        this.OpponentName = aTeam.teamName;
                    }
                }

                // These values shouldn't matter, as UI should check for completion before using
                this.PriorHandicapForOpponent = 0;
                this.OpponentPoints           = 0;
                this.OpponentScoreDifference  = 0;
                this.OpponentScore            = 0;
            }
            else
            {
                this.PriorHandicapForOpponent = opponentResult.priorHandicap;
                this.OpponentName             = opponentResult.player.name;
                this.OpponentPoints           = opponentResult.points;
                this.OpponentScoreDifference  = opponentResult.ScoreDifference();
                this.OpponentScore            = opponentResult.score;
            }

            var tm = r.match.teammatchup;

            this.WeekIndex  = tm.week.seasonIndex;
            this.WeekDate   = tm.week.date;
            this.TeeTime    = tm.TeeTimeText();
            this.CourseName = tm.week.course.name;
        }
 public static int?NetScoreDifference(this result r)
 {
     return(r.ScoreDifference() - r.priorHandicap);
 }
Ejemplo n.º 3
0
 public ResultWithOutcome(result result) : base(result)
 {
     this.WasWin     = result.WasWin();
     this.IsComplete = result.IsComplete();
     this.ScoreDiff  = result.ScoreDifference();
 }