I'm making a blackjack sim and I want to deal the cards how it would be in a casino,
i.e. all players get dealt a card, dealer gets one face down, players get another card, dealer gets one face up
BUT LOOK I VIOLATED DRY :( How to redo??
void BlackJack::newHand()
{
resetHands();
for (unsigned int i = 0; i < players.size(); i++)
players[i]->addCard(deck->nextCard());
Card* c = deck->nextCard();
c->setVisible(false); // dealer gets a face down card
dealer->addCard(c);
for (unsigned int i = 0; i < players.size(); i++)
players[i]->addCard(deck->nextCard());
dealer->addCard(deck->nextCard());
}