Cockatrice/cockatrice/src/game/zones/pile_zone.h
RickyRister 24b5dab456
leave some documentation on Zone classes (#5199)
* leave some documentation on Zone classes

* small refactor

* undo functional change from refactor and clean up comments

* move variables into if block
2024-11-28 14:40:49 -05:00

39 lines
1.2 KiB
C++

#ifndef PILEZONE_H
#define PILEZONE_H
#include "card_zone.h"
/**
* A CardZone where the cards are in a single pile instead of being laid out.
* Usually only top card is accessible by clicking.
*/
class PileZone : public CardZone
{
Q_OBJECT
private slots:
void callUpdate()
{
update();
}
public:
PileZone(Player *_p,
const QString &_name,
bool _isShufflable,
bool _contentsKnown,
QGraphicsItem *parent = nullptr);
QRectF boundingRect() const override;
QPainterPath shape() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
void reorganizeCards() override;
void handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &dropPoint) override;
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
void addCardImpl(CardItem *card, int x, int y) override;
};
#endif