mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[Refactor] Move the attachment graph and card view teardown onto CardState (#7428)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
47c90cda10
commit
2335e064ac
7 changed files with 54 additions and 19 deletions
|
|
@ -356,7 +356,7 @@ void PlayerEventHandler::eventMoveCard(const Event_MoveCard &event, const GameEv
|
|||
}
|
||||
|
||||
if (card->getAttachedTo() && (startZone != targetZone)) {
|
||||
CardItem *parentCard = card->getAttachedTo();
|
||||
CardState *parentCard = card->getAttachedTo();
|
||||
card->setAttachedTo(nullptr);
|
||||
parentCard->getZone()->reorganizeCards();
|
||||
}
|
||||
|
|
@ -440,7 +440,7 @@ void PlayerEventHandler::eventDestroyCard(const Event_DestroyCard &event)
|
|||
|
||||
emit logDestroyCard(player, card->getName());
|
||||
zone->takeCard(-1, event.card_id(), true);
|
||||
card->deleteLater();
|
||||
card->getState()->deleteView();
|
||||
}
|
||||
|
||||
void PlayerEventHandler::eventAttachCard(const Event_AttachCard &event)
|
||||
|
|
@ -469,7 +469,7 @@ void PlayerEventHandler::eventAttachCard(const Event_AttachCard &event)
|
|||
return;
|
||||
}
|
||||
|
||||
CardItem *oldParent = startCard->getAttachedTo();
|
||||
CardState *oldParent = startCard->getAttachedTo();
|
||||
|
||||
startCard->setAttachedTo(targetCard);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue