예제 #1
0
    /* Controls switching between players
     * If a player is finished, the turn is passed on until all players are finished
     */
    public void NextPlayer()
    {
        if (AllPlayersFinished())
        {
            GameOver();
        }

        if (playas.Count - 1 > playas.IndexOf(currentPlayer))
        {
            currentPlayer = playas [playas.IndexOf(currentPlayer) + 1];
            currentPlayer.GetBall().Reset();
            if (currentPlayer.GetPlayerFinished())
            {
                NextPlayer();
            }
        }
        else
        {
            currentPlayer = playas [0];
            currentPlayer.GetBall().Reset();
        }
        currentPlayer.UpdateBallMaterial();
        scoreDisplay.ClearScoreCard();
        UpdateScore(currentPlayer.GetBowls());
    }