mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
small cleanups
This commit is contained in:
parent
890740bcc9
commit
fa16d86283
27 changed files with 616 additions and 497 deletions
|
|
@ -27,9 +27,8 @@ void ZoneViewZone::paint(QPainter */*painter*/, const QStyleOptionGraphicsItem *
|
|||
void ZoneViewZone::initializeCards()
|
||||
{
|
||||
if (!origZone->contentsKnown()) {
|
||||
connect(player->client, SIGNAL(zoneDumpReceived(int, QList<ServerZoneCard *>)), this, SLOT(zoneDumpReceived(int, QList<ServerZoneCard *>)));
|
||||
PendingCommand *dumpZoneCommand = player->client->dumpZone(player->getId(), name, numberCards);
|
||||
cmdId = dumpZoneCommand->getMsgId();
|
||||
PendingCommand_DumpZone *dumpZoneCommand = player->client->dumpZone(player->getId(), name, numberCards);
|
||||
connect(dumpZoneCommand, SIGNAL(cardListReceived(QList<ServerZoneCard>)), this, SLOT(zoneDumpReceived(QList<ServerZoneCard>)));
|
||||
} else {
|
||||
const CardList &c = origZone->getCards();
|
||||
int number = numberCards == -1 ? c.size() : (numberCards < c.size() ? numberCards : c.size());
|
||||
|
|
@ -42,18 +41,11 @@ void ZoneViewZone::initializeCards()
|
|||
}
|
||||
}
|
||||
|
||||
void ZoneViewZone::zoneDumpReceived(int commandId, QList<ServerZoneCard *> cards)
|
||||
void ZoneViewZone::zoneDumpReceived(QList<ServerZoneCard> cards)
|
||||
{
|
||||
if (commandId != cmdId)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < cards.size(); i++) {
|
||||
ServerZoneCard *temp = cards[i];
|
||||
|
||||
CardItem *card = new CardItem(player->getDb(), temp->getName(), i, this);
|
||||
CardItem *card = new CardItem(player->getDb(), cards[i].getName(), i, this);
|
||||
addCard(card, false, i);
|
||||
|
||||
delete temp;
|
||||
}
|
||||
|
||||
emit contentsChanged();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue