Esempio n. 1
0
        public Match(Player player1, Player player2, int bestOf = 3)
        {
            Player1 = player1;
            Player2 = player2;
            BestOf = bestOf;

            var startingSet = new Set();
            Sets = new List<Set> { startingSet };
            CurrentSet = startingSet;
        }
Esempio n. 2
0
        public void AddPoint(Player player)
        {
            if (player == null) throw new ArgumentNullException("player");
            if (Player1 == null) throw new ArgumentNullException("Player1");
            if (Player2 == null) throw new ArgumentNullException("Player2");

            // probably want a custom comparer here
            if (player.Equals(Player1)) { CurrentSet.AddPointToPlayer1(); }
            if (player.Equals(Player2)) { CurrentSet.AddPointToPlayer2(); }

            throw new Exception("Provided player is not playing in this game.");
        }