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(); }
public T DrawCard() { if (!DrawPile.Any()) { DrawPile = new Queue <T>(Discards.Shuffle().ToArray()); Discards.Clear(); } var card = DrawPile.Dequeue(); HandCards.Add(card); return(card); }
// 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(); }