Reveal top x cards

Updated reveal top card to reveal top x cards
Sometimes you want to reveal more than only the top 1 card.
This commit is contained in:
Matt Lowe
2015-05-04 10:49:49 +02:00
parent 9ff22eaf17
commit 59c0834427
3 changed files with 23 additions and 4 deletions

View File

@@ -1522,7 +1522,14 @@ Response::ResponseCode Server_Player::cmdRevealCards(const Command_RevealCards &
return Response::RespNameNotFound;
QList<Server_Card *> cardsToReveal;
if (!cmd.has_card_id())
if (cmd.top_cards() != -1) {
for (int i = 0; i < cmd.top_cards(); i++) {
Server_Card *card = zone->getCard(i);
if (!card)
return Response::RespNameNotFound;
cardsToReveal.append(card);
}
} else if (!cmd.has_card_id())
cardsToReveal = zone->getCards();
else if (cmd.card_id() == -2) {
if (zone->getCards().isEmpty())