我正在制作二十一点模拟游戏,我想像在赌场一样处理卡片,
即所有玩家得到一张牌,庄家得到一张面朝下,玩家得到另一张牌,庄家得到一张面朝上
但看我违反了干:(如何重做??
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());
}