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

#include <card_zone.h>

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

Public Types

enum  { Type = typeZone }

Public Slots

bool showContextMenu (const QPoint &screenPos)
void onCardAdded (CardItem *addedCard)

Public Member Functions

int type () const override
virtual void handleDropEvent (const QList< CardDragItem * > &dragItem, CardZoneLogic *startZone, const QPoint &dropPoint)=0
 CardZone (CardZoneLogic *logic, QGraphicsItem *parent=nullptr)
void retranslateUi ()
CardZoneLogicgetLogic () const
void setMenu (QMenu *_menu, QAction *_doubleClickAction=0)
Public Member Functions inherited from AbstractGraphicsItem
 AbstractGraphicsItem (QGraphicsItem *parent=nullptr)

Protected Member Functions

void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
virtual void reorganizeCards ()=0
virtual QPointF closestGridPoint (const QPointF &point)
QMenu * getMenu () const
Protected Member Functions inherited from AbstractGraphicsItem
void paintNumberEllipse (int number, int radius, const QColor &color, int position, int count, QPainter *painter)

Protected Attributes

QMenu * menu
QAction * doubleClickAction

Private Attributes

CardZoneLogiclogic

Detailed Description

A zone in the game that can contain cards. This class contains methods to get and modify the cards that are contained inside this zone.

The cards are stored as a list of CardItem*.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Constructor & Destructor Documentation

◆ CardZone()

CardZone::CardZone ( CardZoneLogic * logic,
QGraphicsItem * parent = nullptr )
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ closestGridPoint()

QPointF CardZone::closestGridPoint ( const QPointF & point)
protectedvirtual

Reimplemented in TableZone.

◆ getLogic()

CardZoneLogic * CardZone::getLogic ( ) const
inline
Here is the caller graph for this function:

◆ getMenu()

QMenu * CardZone::getMenu ( ) const
inlineprotected

◆ handleDropEvent()

virtual void CardZone::handleDropEvent ( const QList< CardDragItem * > & dragItem,
CardZoneLogic * startZone,
const QPoint & dropPoint )
pure virtual

◆ mouseDoubleClickEvent()

void CardZone::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent * event)
overrideprotected

◆ mousePressEvent()

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

◆ onCardAdded

void CardZone::onCardAdded ( CardItem * addedCard)
slot
Here is the caller graph for this function:

◆ reorganizeCards()

virtual void CardZone::reorganizeCards ( )
protectedpure virtual

Implemented in HandZone, PileZone, StackZone, and ZoneViewZone.

Here is the caller graph for this function:

◆ retranslateUi()

void CardZone::retranslateUi ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMenu()

void CardZone::setMenu ( QMenu * _menu,
QAction * _doubleClickAction = 0 )
inline

◆ showContextMenu

bool CardZone::showContextMenu ( const QPoint & screenPos)
slot
Here is the caller graph for this function:

◆ type()

int CardZone::type ( ) const
inlineoverride

Member Data Documentation

◆ doubleClickAction

QAction* CardZone::doubleClickAction
protected

◆ logic

CardZoneLogic* CardZone::logic
private

◆ menu

QMenu* CardZone::menu
protected

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