CardItem::CardItem(Player *_owner, const QString &_name, int _cardid, bool _revealedCard, QGraphicsItem *parent) : AbstractCardItem(_name, _owner, _cardid, parent), zone(0), revealedCard(_revealedCard), attacking(false), destroyOnZoneChange(false), doesntUntap(false), dragItem(0), attachedTo(0) { owner->addCard(this); cardMenu = new QMenu; ptMenu = new QMenu; moveMenu = new QMenu; retranslateUi(); emit updateCardMenu(this); }
void CardItem::setAttachedTo(CardItem *_attachedTo) { if (attachedTo) attachedTo->removeAttachedCard(this); gridPoint.setX(-1); attachedTo = _attachedTo; if (attachedTo) { setParentItem(attachedTo->getZone()); attachedTo->addAttachedCard(this); if (zone != attachedTo->getZone()) attachedTo->getZone()->reorganizeCards(); } else setParentItem(zone); if (zone) zone->reorganizeCards(); emit updateCardMenu(this); }
void AbstractCardItem::setFaceDown(bool _facedown) { facedown = _facedown; update(); emit updateCardMenu(this); }
void CardItem::setZone(CardZone *_zone) { zone = _zone; emit updateCardMenu(this); }