mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-06 21:43:55 -07:00
[Game][Arrows] Split Arrows into ArrowData and ArrowItem
Took 13 minutes Took 5 seconds Took 1 minute Took 26 seconds
This commit is contained in:
parent
bddf9bd818
commit
dd1936b94e
14 changed files with 338 additions and 324 deletions
|
|
@ -21,12 +21,14 @@ protected:
|
|||
PlayerLogic *owner;
|
||||
|
||||
private:
|
||||
bool beingPointedAt;
|
||||
QList<ArrowItem *> arrowsFrom, arrowsTo;
|
||||
bool beingPointedAt = false;
|
||||
|
||||
signals:
|
||||
void scenePositionChanged();
|
||||
|
||||
public:
|
||||
explicit ArrowTarget(PlayerLogic *_owner, QGraphicsItem *parent = nullptr);
|
||||
~ArrowTarget() override;
|
||||
~ArrowTarget() override = default;
|
||||
|
||||
[[nodiscard]] PlayerLogic *getOwner() const
|
||||
{
|
||||
|
|
@ -39,32 +41,7 @@ public:
|
|||
return beingPointedAt;
|
||||
}
|
||||
|
||||
[[nodiscard]] const QList<ArrowItem *> &getArrowsFrom() const
|
||||
{
|
||||
return arrowsFrom;
|
||||
}
|
||||
void addArrowFrom(ArrowItem *arrow)
|
||||
{
|
||||
arrowsFrom.append(arrow);
|
||||
}
|
||||
void removeArrowFrom(ArrowItem *arrow)
|
||||
{
|
||||
arrowsFrom.removeOne(arrow);
|
||||
}
|
||||
[[nodiscard]] const QList<ArrowItem *> &getArrowsTo() const
|
||||
{
|
||||
return arrowsTo;
|
||||
}
|
||||
void addArrowTo(ArrowItem *arrow)
|
||||
{
|
||||
arrowsTo.append(arrow);
|
||||
}
|
||||
void removeArrowTo(ArrowItem *arrow)
|
||||
{
|
||||
arrowsTo.removeOne(arrow);
|
||||
}
|
||||
|
||||
protected:
|
||||
QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) override;
|
||||
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue