} //end SetUpGame /// <summary> /// Sets up the discard pile so that the first card is the top card of the draw deck, /// also the current suit is changed to that of the top cards /// Pre: drawpile needs to be initialised /// Post: Displays the Top card of the Discard pile and changes the current suit /// </summary> private static void SetUpTheDiscardPile() { discardPile = new CardPile(); //discardPile.Add(new Card(Suit.Hearts, FaceValue.Eight)); discardPile.Add(drawPile.DealOneCard()); DisplayDiscardPileTopCard(); currentSuit = discardPile.GetLastCardInPile().GetSuit(); }
/// <summary> /// Set up to play the game, /// by shuffling the pile of cards and dealing the two hands. /// </summary> public static void SetUpGame() { cardPile = new CardPile(true); cardPile.Shuffle(); hands[USER] = new Hand(cardPile.DealCards(NUM_OF_STARTING_CARDS)); hands[DEALER] = new Hand(cardPile.DealCards(NUM_OF_STARTING_CARDS)); numOfUserAcesWithValueOne = 0; playerHasBust = false; numberOfCardsDealt = 0; } //end SetUpGame
/// <summary> /// Set up to play the game, /// by shuffling the drawPile of cards /// and then dealing the two hands. /// </summary> public static void SetUpGame() { PlayerWon = false; drawPile = new CardPile(true); drawPile.Shuffle(); hands[USER] = new Hand(drawPile.DealCards(NUM_OF_STARTING_CARDS)); hands[COMPUTER] = new Hand(drawPile.DealCards(NUM_OF_STARTING_CARDS)); SetUpTheDiscardPile(); hands[USER].Sort(); hands[COMPUTER].Sort(); } //end SetUpGame