mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Refactor: Represent cardName + providerId with CardRef struct (#6039)
* card_ref.h * update CardDatabase signatures * make everything compile * rename methods * add docs * mark stuff const * set cardRef in CardItem * cleanup * fix build failure * Fix builds on mac --------- Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
This commit is contained in:
parent
e05dad4267
commit
a9b3be33e0
61 changed files with 328 additions and 305 deletions
|
|
@ -67,11 +67,8 @@ void DeckViewCardDragItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
event->accept();
|
||||
}
|
||||
|
||||
DeckViewCard::DeckViewCard(QGraphicsItem *parent,
|
||||
const QString &_name,
|
||||
const QString &_providerId,
|
||||
const QString &_originZone)
|
||||
: AbstractCardItem(parent, _name, _providerId, 0, -1), originZone(_originZone), dragItem(0)
|
||||
DeckViewCard::DeckViewCard(QGraphicsItem *parent, const CardRef &cardRef, const QString &_originZone)
|
||||
: AbstractCardItem(parent, cardRef, 0, -1), originZone(_originZone), dragItem(0)
|
||||
{
|
||||
setAcceptHoverEvents(true);
|
||||
|
||||
|
|
@ -362,8 +359,7 @@ void DeckViewScene::rebuildTree()
|
|||
continue;
|
||||
|
||||
for (int k = 0; k < currentCard->getNumber(); ++k) {
|
||||
DeckViewCard *newCard = new DeckViewCard(container, currentCard->getName(),
|
||||
currentCard->getCardProviderId(), currentZone->getName());
|
||||
DeckViewCard *newCard = new DeckViewCard(container, currentCard->toCardRef(), currentZone->getName());
|
||||
container->addCard(newCard);
|
||||
emit newCardAdded(newCard);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue