public void DealACard(IPlayer PlayerBeingDealtTo) { IPlayer _player = PlayerBeingDealtTo; //deal card to player ICard _card = MainDeck.First(); _player.Hand.CardsInHand.Add(_card); //add card dealt to the player's cards MainDeck.Remove(_card); //remove the card dealt from the deck }
public void Deal() { //Deal two cards to each player for (int counter = 2; counter > 0; counter = counter - 1) { foreach (IPlayer _player in PlayersInGame) { //Deal card to player ICard _card = MainDeck.First(); _player.Hand.CardsInHand.Add(_card); //add card dealt, to the player's cards MainDeck.Remove(_card); //remove the card dealt from the deck } //Deal card to Dealer ICard _dearlersCard = MainDeck.First(); DealerPlayer.Hand.CardsInHand.Add(_dearlersCard); //add card dealt, to the dealer's cards MainDeck.Remove(_dearlersCard); //remove the card dealt from the deck } }