Exemplo n.º 1
0
        /// <summary>
        /// Add a turn to the current game
        /// </summary>
        /// <param name="turn"></param>
        /// <param name="player"></param>
        public void AddTurn(Turn turn, Player player)
        {
            if (turn == null) throw new ArgumentNullException("A turn must be supplied");
            if (player == null) throw new ArgumentNullException("A player must be supplied");

            var playerScore = Scores.FirstOrDefault(score => score.Player.Name == player.Name);
            if (playerScore == null) throw new ArgumentException("Unable to find player in this game.");

            playerScore.Turns.Add(turn);
        }
Exemplo n.º 2
0
 public Score GetScore(Player player)
 {
     return Scores.FirstOrDefault(x => x.Player == player);
 }