예제 #1
0
        private void UpdateCurrentPlayer()
        {
            var player = _players[_currentPlayerIndex];

            if (player.CurrentFrameIndex > 9 && player.IsDone())
            {
                _currentPlayerIndex = BowlingHelper.GetNextPlayerIndex(_players.Count, _currentPlayerIndex);
                player.UpdateFinalScore();
            }
            else if (player.CurrentFrameIndex <= 9 && player.CurrentThrow == 1)
            {
                _currentPlayerIndex = BowlingHelper.GetNextPlayerIndex(_players.Count, _currentPlayerIndex);
            }
        }
예제 #2
0
        private void UpdateButtonsVisible()
        {
            var player = _players[_currentPlayerIndex];

            if (BowlingHelper.IsGameOver(_currentPlayerIndex, player.IsDone()))
            {
                HideButtons();
                return;
            }

            for (var i = 0; i < 11; i++)
            {
                _buttons[i].Visible = player.CurrentFrameTotal + i <= 10;
            }
        }