Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
AbstractCardItem Class Reference

#include <abstract_card_item.h>

Inheritance diagram for AbstractCardItem:
[legend]
Collaboration diagram for AbstractCardItem:
[legend]

Public Types

enum  { Type = typeCard }

Public Slots

void refreshCardInfo ()

Signals

void hovered (AbstractCardItem *card)
void showCardInfoPopup (const QPoint &pos, const CardRef &cardRef)
void deleteCardInfoPopup (QString cardName)
void sigPixmapUpdated ()
void cardShiftClicked (QString cardName)

Public Member Functions

int type () const override
 AbstractCardItem (QGraphicsItem *parent=nullptr, const CardRef &cardRef={}, Player *_owner=nullptr, int _id=-1)
 ~AbstractCardItem () override
QRectF boundingRect () const override
QPainterPath shape () const override
QSizeF getTranslatedSize (QPainter *painter) const
void paintPicture (QPainter *painter, const QSizeF &translatedSize, int angle)
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
ExactCard getCard () const
const CardInfogetCardInfo () const
int getId () const
void setId (int _id)
QString getName () const
QString getProviderId () const
void setCardRef (const CardRef &_cardRef)
CardRef getCardRef () const
qreal getRealZValue () const
void setRealZValue (qreal _zValue)
void setHovered (bool _hovered)
QString getColor () const
void setColor (const QString &_color)
bool getTapped () const
void setTapped (bool _tapped, bool canAnimate=false)
bool getFaceDown () const
void setFaceDown (bool _facedown)
void processHoverEvent ()
void deleteCardInfoPopup ()
Public Member Functions inherited from ArrowTarget
 ArrowTarget (Player *_owner, QGraphicsItem *parent=nullptr)
 ~ArrowTarget () override
PlayergetOwner () const
void setBeingPointedAt (bool _beingPointedAt)
bool getBeingPointedAt () const
const QList< ArrowItem * > & getArrowsFrom () const
void addArrowFrom (ArrowItem *arrow)
void removeArrowFrom (ArrowItem *arrow)
const QList< ArrowItem * > & getArrowsTo () const
void addArrowTo (ArrowItem *arrow)
void removeArrowTo (ArrowItem *arrow)
Public Member Functions inherited from AbstractGraphicsItem
 AbstractGraphicsItem (QGraphicsItem *parent=nullptr)

Protected Member Functions

void transformPainter (QPainter *painter, const QSizeF &translatedSize, int angle)
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
QVariant itemChange (QGraphicsItem::GraphicsItemChange change, const QVariant &value) override
void cacheBgColor ()
Protected Member Functions inherited from ArrowTarget
QVariant itemChange (QGraphicsItem::GraphicsItemChange change, const QVariant &value) override
Protected Member Functions inherited from AbstractGraphicsItem
void paintNumberEllipse (int number, int radius, const QColor &color, int position, int count, QPainter *painter)

Protected Attributes

ExactCard exactCard
int id
CardRef cardRef
bool tapped
bool facedown
int tapAngle
QString color
QColor bgColor
Protected Attributes inherited from ArrowTarget
Playerowner

Private Slots

void pixmapUpdated ()

Private Attributes

bool isHovered
qreal realZValue

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Constructor & Destructor Documentation

◆ AbstractCardItem()

AbstractCardItem::AbstractCardItem ( QGraphicsItem * parent = nullptr,
const CardRef & cardRef = {},
Player * _owner = nullptr,
int _id = -1 )
explicit
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~AbstractCardItem()

AbstractCardItem::~AbstractCardItem ( )
override
Here is the call graph for this function:

Member Function Documentation

◆ boundingRect()

QRectF AbstractCardItem::boundingRect ( ) const
override
Here is the caller graph for this function:

◆ cacheBgColor()

void AbstractCardItem::cacheBgColor ( )
protected
Here is the caller graph for this function:

◆ cardShiftClicked

void AbstractCardItem::cardShiftClicked ( QString cardName)
signal
Here is the caller graph for this function:

◆ deleteCardInfoPopup() [1/2]

void AbstractCardItem::deleteCardInfoPopup ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteCardInfoPopup [2/2]

void AbstractCardItem::deleteCardInfoPopup ( QString cardName)
signal
Here is the caller graph for this function:

◆ getCard()

ExactCard AbstractCardItem::getCard ( ) const
inline
Here is the caller graph for this function:

◆ getCardInfo()

const CardInfo & AbstractCardItem::getCardInfo ( ) const

Convenience method to get the CardInfo of the exactCard

Returns
A const reference to the CardInfo, or an empty CardInfo if card was null
Here is the caller graph for this function:

◆ getCardRef()

CardRef AbstractCardItem::getCardRef ( ) const
inline
Here is the caller graph for this function:

◆ getColor()

QString AbstractCardItem::getColor ( ) const
inline

◆ getFaceDown()

bool AbstractCardItem::getFaceDown ( ) const
inline
Here is the caller graph for this function:

◆ getId()

int AbstractCardItem::getId ( ) const
inline
Here is the caller graph for this function:

◆ getName()

QString AbstractCardItem::getName ( ) const
inline
Here is the caller graph for this function:

◆ getProviderId()

QString AbstractCardItem::getProviderId ( ) const
inline
Here is the caller graph for this function:

◆ getRealZValue()

qreal AbstractCardItem::getRealZValue ( ) const
inline
Here is the caller graph for this function:

◆ getTapped()

bool AbstractCardItem::getTapped ( ) const
inline
Here is the caller graph for this function:

◆ getTranslatedSize()

QSizeF AbstractCardItem::getTranslatedSize ( QPainter * painter) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hovered

void AbstractCardItem::hovered ( AbstractCardItem * card)
signal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ itemChange()

QVariant AbstractCardItem::itemChange ( QGraphicsItem::GraphicsItemChange change,
const QVariant & value )
overrideprotected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mousePressEvent()

void AbstractCardItem::mousePressEvent ( QGraphicsSceneMouseEvent * event)
overrideprotected
Here is the call graph for this function:

◆ mouseReleaseEvent()

void AbstractCardItem::mouseReleaseEvent ( QGraphicsSceneMouseEvent * event)
overrideprotected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ paint()

void AbstractCardItem::paint ( QPainter * painter,
const QStyleOptionGraphicsItem * option,
QWidget * widget )
override
Here is the call graph for this function:
Here is the caller graph for this function:

◆ paintPicture()

void AbstractCardItem::paintPicture ( QPainter * painter,
const QSizeF & translatedSize,
int angle )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pixmapUpdated

void AbstractCardItem::pixmapUpdated ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processHoverEvent()

void AbstractCardItem::processHoverEvent ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshCardInfo

void AbstractCardItem::refreshCardInfo ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCardRef()

void AbstractCardItem::setCardRef ( const CardRef & _cardRef)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setColor()

void AbstractCardItem::setColor ( const QString & _color)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFaceDown()

void AbstractCardItem::setFaceDown ( bool _facedown)
Here is the caller graph for this function:

◆ setHovered()

void AbstractCardItem::setHovered ( bool _hovered)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setId()

void AbstractCardItem::setId ( int _id)
inline
Here is the caller graph for this function:

◆ setRealZValue()

void AbstractCardItem::setRealZValue ( qreal _zValue)
Here is the caller graph for this function:

◆ setTapped()

void AbstractCardItem::setTapped ( bool _tapped,
bool canAnimate = false )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shape()

QPainterPath AbstractCardItem::shape ( ) const
override
Here is the call graph for this function:
Here is the caller graph for this function:

◆ showCardInfoPopup

void AbstractCardItem::showCardInfoPopup ( const QPoint & pos,
const CardRef & cardRef )
signal
Here is the caller graph for this function:

◆ sigPixmapUpdated

void AbstractCardItem::sigPixmapUpdated ( )
signal
Here is the caller graph for this function:

◆ transformPainter()

void AbstractCardItem::transformPainter ( QPainter * painter,
const QSizeF & translatedSize,
int angle )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ type()

int AbstractCardItem::type ( ) const
inlineoverride

Member Data Documentation

◆ bgColor

QColor AbstractCardItem::bgColor
protected

◆ cardRef

CardRef AbstractCardItem::cardRef
protected

◆ color

QString AbstractCardItem::color
protected

◆ exactCard

ExactCard AbstractCardItem::exactCard
protected

◆ facedown

bool AbstractCardItem::facedown
protected

◆ id

int AbstractCardItem::id
protected

◆ isHovered

bool AbstractCardItem::isHovered
private

◆ realZValue

qreal AbstractCardItem::realZValue
private

◆ tapAngle

int AbstractCardItem::tapAngle
protected

◆ tapped

bool AbstractCardItem::tapped
protected

The documentation for this class was generated from the following files: