예제 #1
0
    private string DetermineRoundWinner()
    {
        int            player   = playerCounter.GetCurrentPoints();
        int            opponent = opponentCounter.GetCurrentPoints();
        RoundTokenPile pile;
        string         outcome = "";

        if (player > opponent)
        {
            outcome = "Player Won The Round!";
            pile    = Opponent.GetTokens();
            pile.DisableToken();
            Player.IncreaseScore();
            RoundWinner = Player;
            //PlayerDeck.DealCards(1, Player.GetHand().gameObject);
        }
        else if (player < opponent)
        {
            outcome = "Opponent Won The Round!";
            pile    = Player.GetTokens();
            pile.DisableToken();
            Opponent.IncreaseScore();
            RoundWinner = Opponent;
            //OpponentDeck.DealCards(1, Opponent.GetHand().gameObject);
        }
        else
        {
            outcome = "DRAW";
            pile    = Player.GetTokens();
            pile.DisableToken();
            pile = Opponent.GetTokens();
            pile.DisableToken();
            RoundWinner = null;
        }
        games_played++;
        return(outcome);
    }