mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 11:03:54 -07:00
Mark more functions as [[nodiscard]] (#6320)
* Fix local variable double declaration. Took 44 seconds * Mark functions as [[nodiscard]] Took 31 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
27708d5964
commit
73763b5ee6
65 changed files with 258 additions and 257 deletions
|
|
@ -27,22 +27,22 @@ public:
|
|||
{
|
||||
Type = typeCardDrag
|
||||
};
|
||||
int type() const override
|
||||
[[nodiscard]] int type() const override
|
||||
{
|
||||
return Type;
|
||||
}
|
||||
AbstractCardDragItem(AbstractCardItem *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag = 0);
|
||||
QRectF boundingRect() const override
|
||||
[[nodiscard]] QRectF boundingRect() const override
|
||||
{
|
||||
return QRectF(0, 0, CARD_WIDTH, CARD_HEIGHT);
|
||||
}
|
||||
QPainterPath shape() const override;
|
||||
[[nodiscard]] QPainterPath shape() const override;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||
AbstractCardItem *getItem() const
|
||||
[[nodiscard]] AbstractCardItem *getItem() const
|
||||
{
|
||||
return item;
|
||||
}
|
||||
QPointF getHotSpot() const
|
||||
[[nodiscard]] QPointF getHotSpot() const
|
||||
{
|
||||
return hotSpot;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,22 +36,22 @@ public:
|
|||
ArrowItem(Player *_player, int _id, ArrowTarget *_startItem, ArrowTarget *_targetItem, const QColor &color);
|
||||
~ArrowItem() override;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||
QRectF boundingRect() const override
|
||||
[[nodiscard]] QRectF boundingRect() const override
|
||||
{
|
||||
return path.boundingRect();
|
||||
}
|
||||
QPainterPath shape() const override
|
||||
[[nodiscard]] QPainterPath shape() const override
|
||||
{
|
||||
return path;
|
||||
}
|
||||
void updatePath();
|
||||
void updatePath(const QPointF &endPoint);
|
||||
|
||||
int getId() const
|
||||
[[nodiscard]] int getId() const
|
||||
{
|
||||
return id;
|
||||
}
|
||||
Player *getPlayer() const
|
||||
[[nodiscard]] Player *getPlayer() const
|
||||
{
|
||||
return player;
|
||||
}
|
||||
|
|
@ -63,11 +63,11 @@ public:
|
|||
{
|
||||
targetItem = _item;
|
||||
}
|
||||
ArrowTarget *getStartItem() const
|
||||
[[nodiscard]] ArrowTarget *getStartItem() const
|
||||
{
|
||||
return startItem;
|
||||
}
|
||||
ArrowTarget *getTargetItem() const
|
||||
[[nodiscard]] ArrowTarget *getTargetItem() const
|
||||
{
|
||||
return targetItem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,18 +28,18 @@ public:
|
|||
explicit ArrowTarget(Player *_owner, QGraphicsItem *parent = nullptr);
|
||||
~ArrowTarget() override;
|
||||
|
||||
Player *getOwner() const
|
||||
[[nodiscard]] Player *getOwner() const
|
||||
{
|
||||
return owner;
|
||||
}
|
||||
|
||||
void setBeingPointedAt(bool _beingPointedAt);
|
||||
bool getBeingPointedAt() const
|
||||
[[nodiscard]] bool getBeingPointedAt() const
|
||||
{
|
||||
return beingPointedAt;
|
||||
}
|
||||
|
||||
const QList<ArrowItem *> &getArrowsFrom() const
|
||||
[[nodiscard]] const QList<ArrowItem *> &getArrowsFrom() const
|
||||
{
|
||||
return arrowsFrom;
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ public:
|
|||
{
|
||||
arrowsFrom.removeOne(arrow);
|
||||
}
|
||||
const QList<ArrowItem *> &getArrowsTo() const
|
||||
[[nodiscard]] const QList<ArrowItem *> &getArrowsTo() const
|
||||
{
|
||||
return arrowsTo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public:
|
|||
{
|
||||
Type = typeCard
|
||||
};
|
||||
int type() const override
|
||||
[[nodiscard]] int type() const override
|
||||
{
|
||||
return Type;
|
||||
}
|
||||
|
|
@ -62,13 +62,13 @@ public:
|
|||
CardZoneLogic *_zone = nullptr);
|
||||
|
||||
void retranslateUi();
|
||||
CardZoneLogic *getZone() const
|
||||
[[nodiscard]] CardZoneLogic *getZone() const
|
||||
{
|
||||
return zone;
|
||||
}
|
||||
void setZone(CardZoneLogic *_zone);
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||
QPoint getGridPoint() const
|
||||
[[nodiscard]] QPoint getGridPoint() const
|
||||
{
|
||||
return gridPoint;
|
||||
}
|
||||
|
|
@ -76,11 +76,11 @@ public:
|
|||
{
|
||||
gridPoint = _gridPoint;
|
||||
}
|
||||
QPoint getGridPos() const
|
||||
[[nodiscard]] QPoint getGridPos() const
|
||||
{
|
||||
return gridPoint;
|
||||
}
|
||||
Player *getOwner() const
|
||||
[[nodiscard]] Player *getOwner() const
|
||||
{
|
||||
return owner;
|
||||
}
|
||||
|
|
@ -88,32 +88,32 @@ public:
|
|||
{
|
||||
owner = _owner;
|
||||
}
|
||||
bool getAttacking() const
|
||||
[[nodiscard]] bool getAttacking() const
|
||||
{
|
||||
return attacking;
|
||||
}
|
||||
void setAttacking(bool _attacking);
|
||||
const QMap<int, int> &getCounters() const
|
||||
[[nodiscard]] const QMap<int, int> &getCounters() const
|
||||
{
|
||||
return counters;
|
||||
}
|
||||
void setCounter(int _id, int _value);
|
||||
QString getAnnotation() const
|
||||
[[nodiscard]] QString getAnnotation() const
|
||||
{
|
||||
return annotation;
|
||||
}
|
||||
void setAnnotation(const QString &_annotation);
|
||||
bool getDoesntUntap() const
|
||||
[[nodiscard]] bool getDoesntUntap() const
|
||||
{
|
||||
return doesntUntap;
|
||||
}
|
||||
void setDoesntUntap(bool _doesntUntap);
|
||||
QString getPT() const
|
||||
[[nodiscard]] QString getPT() const
|
||||
{
|
||||
return pt;
|
||||
}
|
||||
void setPT(const QString &_pt);
|
||||
bool getDestroyOnZoneChange() const
|
||||
[[nodiscard]] bool getDestroyOnZoneChange() const
|
||||
{
|
||||
return destroyOnZoneChange;
|
||||
}
|
||||
|
|
@ -121,7 +121,7 @@ public:
|
|||
{
|
||||
destroyOnZoneChange = _destroy;
|
||||
}
|
||||
CardItem *getAttachedTo() const
|
||||
[[nodiscard]] CardItem *getAttachedTo() const
|
||||
{
|
||||
return attachedTo;
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@ public:
|
|||
{
|
||||
attachedCards.removeOne(card);
|
||||
}
|
||||
const QList<CardItem *> &getAttachedCards() const
|
||||
[[nodiscard]] const QList<CardItem *> &getAttachedCards() const
|
||||
{
|
||||
return attachedCards;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue