// CONSTRUCTORS public cardController(List <player> players) { // Create shoe shoe shoe = new shoe(); this.shoeObj = shoe; // Create playerHands for each player and add to list List <playerHand> playerHands = new List <playerHand>(); foreach (player player in players) { playerHands.Add(new playerHand(player)); } this.playerHands = playerHands; // Create deck for the card controller deck newDeck = new deck(shoe); this.cardDeck = newDeck; // Add each card in the deck to the shoe location shoe.setCards(newDeck.getCards()); // Shuffle shoe shoe.shuffle(); }
public deck(shoe shoe) { List <card> cardsInProg = new List <card>(); // Pull in suits and ranks from deckInfo List <cardSuit> suits = deckInfo.getCardSuits(); List <cardRank> ranks = deckInfo.getCardRanks(); // Iterate through suits and ranks and create a card for each. Set each card location to shoe. foreach (cardSuit suit in suits) { foreach (cardRank rank in ranks) { cardsInProg.Add(new card(rank, suit, shoe)); } } this.cards = cardsInProg; }