Exemplo n.º 1
0
 private void CleanUpCards()
 {
     HumanCards.Clear();
     ComputerCards.Clear();
     RemainingDeck.Clear();
     Discards.Clear();
     Deal();
 }
Exemplo n.º 2
0
 private void nextRound()
 {
     CheckForEndGame();
     takenFromDeckOrDiscardPile = false;
     canNowDiscard = false;
     HumanCards.Clear();
     ComputerCards.Clear();
     RemainingDeck.Clear();
     Discards.Clear();
     Deal();
 }
Exemplo n.º 3
0
        public T DrawCard()
        {
            if (!DrawPile.Any())
            {
                DrawPile = new Queue <T>(Discards.Shuffle().ToArray());
                Discards.Clear();
            }
            var card = DrawPile.Dequeue();

            HandCards.Add(card);
            return(card);
        }
Exemplo n.º 4
0
        // Function to reset the game for next rounds
        // The game will continue if none of player has exceeded
        // maximum score to win
        private void resetGame()
        {
            Discards.Clear();
            HumanCards.Clear();
            ComputerCards.Clear();
            RemainingDeck.Clear();
            PossibleDeck.Clear();
            startGame    = false;
            playerTurn   = true;
            humanDraw    = false;
            humanDiscard = false;

            if (firstWinnerScore >= winingScore || secondWinnerScore >= winingScore)
            {
                scoreReset();
            }
            Deal();
        }