Example #1
0
        public MatchResult AddResult(Golfer playerA, int playerAScore, decimal playerAPoints, bool playerANextWeek,
                                     Golfer playerB, int playerBScore, decimal playerBPoints, bool playerBNextWeek)
        {
            var match = new MatchResult();

            match.AddPlayer(playerA, playerAScore, playerAPoints, playerANextWeek);
            match.AddPlayer(playerB, playerBScore, playerBPoints, playerBNextWeek);
            Matches.Add(match);
            return(match);
        }
Example #2
0
        public PlayerResult AddPlayer(Golfer golfer, int score, decimal points, bool playNextWeek)
        {
            if (golfer == null)
            {
                throw new ArgumentNullException(nameof(golfer));
            }

            var player = new PlayerResult
            {
                Golfer       = golfer,
                PlayNextWeek = playNextWeek,
                Score        = score,
                Strokes      = golfer.LeagueHandicap,
                Points       = points
            };

            Players.Add(player);
            return(player);
        }