mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 11:03:25 -08:00
[Refactor] Give graphics zones a card item cache and own card placement (#7427)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
4879ddbd0f
commit
47c90cda10
18 changed files with 111 additions and 74 deletions
|
|
@ -63,6 +63,14 @@ CardItem::CardItem(PlayerLogic *_owner,
|
|||
update();
|
||||
}
|
||||
});
|
||||
|
||||
connect(state, &CardState::stateReset, this, [this] {
|
||||
attachedCards.clear();
|
||||
if (scene()) {
|
||||
static_cast<GameScene *>(scene())->unregisterAnimationItem(this);
|
||||
}
|
||||
update();
|
||||
});
|
||||
}
|
||||
|
||||
void CardItem::prepareDelete()
|
||||
|
|
@ -250,13 +258,6 @@ void CardItem::setAttachedTo(CardItem *_attachedTo)
|
|||
void CardItem::resetState(bool keepAnnotations)
|
||||
{
|
||||
state->resetState(keepAnnotations);
|
||||
attachedCards.clear();
|
||||
setTapped(false, false);
|
||||
setDoesntUntap(false);
|
||||
if (scene()) {
|
||||
static_cast<GameScene *>(scene())->unregisterAnimationItem(this);
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
void CardItem::processCardInfo(const ServerInfo_Card &_info)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue