mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-02 03:23:56 -07:00
add missing override and explicit specifiers to all classes in src/game (#5511)
This commit is contained in:
parent
af161f00b7
commit
66e2e7a473
27 changed files with 140 additions and 137 deletions
|
|
@ -37,8 +37,8 @@ protected:
|
|||
bool isShufflable;
|
||||
bool isView;
|
||||
bool alwaysRevealTopCard;
|
||||
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
|
||||
virtual void addCardImpl(CardItem *card, int x, int y) = 0;
|
||||
signals:
|
||||
void cardCountChanged();
|
||||
|
|
@ -54,7 +54,7 @@ public:
|
|||
{
|
||||
Type = typeZone
|
||||
};
|
||||
int type() const
|
||||
int type() const override
|
||||
{
|
||||
return Type;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,14 +15,14 @@ public slots:
|
|||
|
||||
public:
|
||||
HandZone(Player *_p, bool _contentsKnown, int _zoneHeight, QGraphicsItem *parent = nullptr);
|
||||
void handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &dropPoint);
|
||||
QRectF boundingRect() const;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
void reorganizeCards();
|
||||
void handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &dropPoint) override;
|
||||
QRectF boundingRect() const override;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||
void reorganizeCards() override;
|
||||
void setWidth(qreal _width);
|
||||
|
||||
protected:
|
||||
void addCardImpl(CardItem *card, int x, int y);
|
||||
void addCardImpl(CardItem *card, int x, int y) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ private:
|
|||
QSet<CardItem *> cardsInSelectionRect;
|
||||
|
||||
protected:
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
|
||||
|
||||
public:
|
||||
SelectZone(Player *_player,
|
||||
|
|
|
|||
|
|
@ -13,13 +13,13 @@ private slots:
|
|||
|
||||
public:
|
||||
StackZone(Player *_p, int _zoneHeight, QGraphicsItem *parent = nullptr);
|
||||
void handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &dropPoint);
|
||||
QRectF boundingRect() const;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
void reorganizeCards();
|
||||
void handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &dropPoint) override;
|
||||
QRectF boundingRect() const override;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||
void reorganizeCards() override;
|
||||
|
||||
protected:
|
||||
void addCardImpl(CardItem *card, int x, int y);
|
||||
void addCardImpl(CardItem *card, int x, int y) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public slots:
|
|||
/**
|
||||
Reorganizes CardItems in the TableZone
|
||||
*/
|
||||
void reorganizeCards();
|
||||
void reorganizeCards() override;
|
||||
|
||||
public:
|
||||
/**
|
||||
|
|
@ -98,12 +98,12 @@ public:
|
|||
@param _p the Player
|
||||
@param parent defaults to null
|
||||
*/
|
||||
TableZone(Player *_p, QGraphicsItem *parent = nullptr);
|
||||
explicit TableZone(Player *_p, QGraphicsItem *parent = nullptr);
|
||||
|
||||
/**
|
||||
@return a QRectF of the TableZone bounding box.
|
||||
*/
|
||||
QRectF boundingRect() const;
|
||||
QRectF boundingRect() const override;
|
||||
|
||||
/**
|
||||
Render the TableZone
|
||||
|
|
@ -111,7 +111,7 @@ public:
|
|||
@param painter
|
||||
@param option
|
||||
*/
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||
|
||||
/**
|
||||
Toggles the selected items as tapped.
|
||||
|
|
@ -121,7 +121,7 @@ public:
|
|||
/**
|
||||
See HandleDropEventByGrid
|
||||
*/
|
||||
void handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &dropPoint);
|
||||
void handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &dropPoint) override;
|
||||
|
||||
/**
|
||||
Handles the placement of cards
|
||||
|
|
@ -138,7 +138,7 @@ public:
|
|||
*/
|
||||
CardItem *getCardFromCoords(const QPointF &point) const;
|
||||
|
||||
QPointF closestGridPoint(const QPointF &point);
|
||||
QPointF closestGridPoint(const QPointF &point) override;
|
||||
|
||||
static int clampValidTableRow(const int row);
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ public:
|
|||
@param canResize defaults to true
|
||||
@return CardItem that has been removed
|
||||
*/
|
||||
CardItem *takeCard(int position, int cardId, bool canResize = true);
|
||||
CardItem *takeCard(int position, int cardId, bool canResize = true) override;
|
||||
|
||||
/**
|
||||
Resizes the TableZone in case CardItems are within or
|
||||
|
|
@ -178,7 +178,7 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
void addCardImpl(CardItem *card, int x, int y);
|
||||
void addCardImpl(CardItem *card, int x, int y) override;
|
||||
|
||||
private:
|
||||
void paintZoneOutline(QPainter *painter);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ private:
|
|||
|
||||
QRectF bRect, optimumRect;
|
||||
int minRows, numberCards;
|
||||
void handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &dropPoint);
|
||||
CardZone *origZone;
|
||||
bool revealZone, writeableRevealZone;
|
||||
CardList::SortOption groupBy, sortBy;
|
||||
|
|
@ -57,6 +56,8 @@ private:
|
|||
|
||||
GridSize positionCardsForDisplay(CardList &cards, CardList::SortOption pileOption = CardList::NoSort);
|
||||
|
||||
void handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &dropPoint) override;
|
||||
|
||||
public:
|
||||
ZoneViewZone(Player *_p,
|
||||
CardZone *_origZone,
|
||||
|
|
@ -65,16 +66,16 @@ public:
|
|||
bool _writeableRevealZone = false,
|
||||
QGraphicsItem *parent = nullptr,
|
||||
bool _isReversed = false);
|
||||
QRectF boundingRect() const;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
void reorganizeCards();
|
||||
QRectF boundingRect() const override;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||
void reorganizeCards() override;
|
||||
void initializeCards(const QList<const ServerInfo_Card *> &cardList = QList<const ServerInfo_Card *>());
|
||||
void removeCard(int position);
|
||||
int getNumberCards() const
|
||||
{
|
||||
return numberCards;
|
||||
}
|
||||
void setGeometry(const QRectF &rect);
|
||||
void setGeometry(const QRectF &rect) override;
|
||||
QRectF getOptimumRect() const
|
||||
{
|
||||
return optimumRect;
|
||||
|
|
@ -105,9 +106,9 @@ signals:
|
|||
void wheelEventReceived(QGraphicsSceneWheelEvent *event);
|
||||
|
||||
protected:
|
||||
void addCardImpl(CardItem *card, int x, int y);
|
||||
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
|
||||
void wheelEvent(QGraphicsSceneWheelEvent *event);
|
||||
void addCardImpl(CardItem *card, int x, int y) override;
|
||||
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override;
|
||||
void wheelEvent(QGraphicsSceneWheelEvent *event) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ private slots:
|
|||
void resizeToZoneContents();
|
||||
void handleScrollBarChange(int value);
|
||||
void zoneDeleted();
|
||||
void moveEvent(QGraphicsSceneMoveEvent * /* event */);
|
||||
void resizeEvent(QGraphicsSceneResizeEvent * /* event */);
|
||||
void moveEvent(QGraphicsSceneMoveEvent * /* event */) override;
|
||||
void resizeEvent(QGraphicsSceneResizeEvent * /* event */) override;
|
||||
|
||||
public:
|
||||
ZoneViewWidget(Player *_player,
|
||||
|
|
@ -88,8 +88,8 @@ public:
|
|||
void retranslateUi();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void initStyleOption(QStyleOption *option) const;
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
void initStyleOption(QStyleOption *option) const override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue