예제 #1
0
        public void Roll(int roll)
        {
            if (roll < 0)
            {
                throw new ArgumentException("Invalid roll!");
            }

            if (!IsPlayable)
            {
                throw new InvalidOperationException("Cannot roll if game not playable.");
            }

            Console.WriteLine(CurrentPlayer + " is the current player");
            Console.WriteLine("They have rolled a " + roll);

            if (_playerService.HasCurrentPlayerIncurredPenalty())
            {
                if (_playerService.CanTemporarilyOvercomePenalty(roll))
                {
                    Move(roll);
                }
            }
            else
            {
                Move(roll);
            }
        }