Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
arrow_target.h
Go to the documentation of this file.
1
6
7#ifndef ARROWTARGET_H
8#define ARROWTARGET_H
9
11
12#include <QList>
13
14class Player;
15class ArrowItem;
16
18{
19 Q_OBJECT
20protected:
22
23private:
25 QList<ArrowItem *> arrowsFrom, arrowsTo;
26
27public:
28 explicit ArrowTarget(Player *_owner, QGraphicsItem *parent = nullptr);
29 ~ArrowTarget() override;
30
31 [[nodiscard]] Player *getOwner() const
32 {
33 return owner;
34 }
35
36 void setBeingPointedAt(bool _beingPointedAt);
37 [[nodiscard]] bool getBeingPointedAt() const
38 {
39 return beingPointedAt;
40 }
41
42 [[nodiscard]] const QList<ArrowItem *> &getArrowsFrom() const
43 {
44 return arrowsFrom;
45 }
47 {
48 arrowsFrom.append(arrow);
49 }
51 {
52 arrowsFrom.removeOne(arrow);
53 }
54 [[nodiscard]] const QList<ArrowItem *> &getArrowsTo() const
55 {
56 return arrowsTo;
57 }
58 void addArrowTo(ArrowItem *arrow)
59 {
60 arrowsTo.append(arrow);
61 }
63 {
64 arrowsTo.removeOne(arrow);
65 }
66
67protected:
68 QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) override;
69};
70#endif
TODO: Document this.
AbstractGraphicsItem(QGraphicsItem *parent=nullptr)
Definition abstract_graphics_item.h:23
Definition arrow_item.h:19
void addArrowTo(ArrowItem *arrow)
Definition arrow_target.h:58
const QList< ArrowItem * > & getArrowsFrom() const
Definition arrow_target.h:42
void removeArrowFrom(ArrowItem *arrow)
Definition arrow_target.h:50
QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) override
Definition arrow_target.cpp:30
bool getBeingPointedAt() const
Definition arrow_target.h:37
const QList< ArrowItem * > & getArrowsTo() const
Definition arrow_target.h:54
Player * getOwner() const
Definition arrow_target.h:31
QList< ArrowItem * > arrowsFrom
Definition arrow_target.h:25
bool beingPointedAt
Definition arrow_target.h:24
void removeArrowTo(ArrowItem *arrow)
Definition arrow_target.h:62
QList< ArrowItem * > arrowsTo
Definition arrow_target.h:25
void addArrowFrom(ArrowItem *arrow)
Definition arrow_target.h:46
void setBeingPointedAt(bool _beingPointedAt)
Definition arrow_target.cpp:24
Player * owner
Definition arrow_target.h:21
ArrowTarget(Player *_owner, QGraphicsItem *parent=nullptr)
Definition arrow_target.cpp:6
~ArrowTarget() override
Definition arrow_target.cpp:12
Definition player.h:65