Exemplo n.º 1
0
        public GameResult NextRound(Choice playerChoice, Choice aiChoice)
        {
            var gameResult = ChooseWinner(playerChoice, aiChoice);

            var currentRound = new GameRound
            {
                PlayerChoice = playerChoice,
                AiChoice     = aiChoice,
                Result       = gameResult,
                RoundCount   = ++Round
            };

            switch (gameResult)
            {
            case GameResult.Win:
                Score.PlayerWins++;
                break;

            case GameResult.Lose:
                Score.AiWins++;
                break;

            case GameResult.Draw:
                Score.Draws++;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            History.Add(currentRound);

            return(gameResult);
        }
Exemplo n.º 2
0
 public void Add(GameRound round)
 {
     Rounds.Add(round);
 }