Esempio n. 1
0
 private void CleanUpCards()
 {
     HumanCards.Clear();
     ComputerCards.Clear();
     RemainingDeck.Clear();
     Discards.Clear();
     Deal();
 }
 private void nextRound()
 {
     CheckForEndGame();
     takenFromDeckOrDiscardPile = false;
     canNowDiscard = false;
     HumanCards.Clear();
     ComputerCards.Clear();
     RemainingDeck.Clear();
     Discards.Clear();
     Deal();
 }
Esempio 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);
        }
Esempio 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();
        }