[Game] Give a graphics_item_type.h to arrow_item.h

Took 23 minutes
This commit is contained in:
Lukas Brübach 2026-08-21 19:12:45 +02:00
parent ed4eb1cb31
commit 7ff0e3feb0
2 changed files with 11 additions and 1 deletions

View file

@ -4,6 +4,7 @@
#include "../../game/board/arrow_data.h" #include "../../game/board/arrow_data.h"
#include "../animated_item.h" #include "../animated_item.h"
#include "arrow_target.h" #include "arrow_target.h"
#include "graphics_item_type.h"
#include <QElapsedTimer> #include <QElapsedTimer>
#include <QGraphicsItem> #include <QGraphicsItem>
@ -48,6 +49,14 @@ protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event) override; void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
public: public:
enum
{
Type = typeArrow
};
[[nodiscard]] int type() const override
{
return Type;
}
ArrowItem(QSharedPointer<const ArrowData> _data, ArrowTarget *_startItem, ArrowTarget *_targetItem); ArrowItem(QSharedPointer<const ArrowData> _data, ArrowTarget *_startItem, ArrowTarget *_targetItem);
~ArrowItem() override; ~ArrowItem() override;

View file

@ -16,7 +16,8 @@ enum GraphicsItemType
typeZone = QGraphicsItem::UserType + 3, typeZone = QGraphicsItem::UserType + 3,
typePlayerTarget = QGraphicsItem::UserType + 4, typePlayerTarget = QGraphicsItem::UserType + 4,
typeDeckViewCardContainer = QGraphicsItem::UserType + 5, typeDeckViewCardContainer = QGraphicsItem::UserType + 5,
typeOther = QGraphicsItem::UserType + 6 typeOther = QGraphicsItem::UserType + 6,
typeArrow = QGraphicsItem::UserType + 7
}; };
#endif // COCKATRICE_GRAPHICS_ITEM_TYPE_H #endif // COCKATRICE_GRAPHICS_ITEM_TYPE_H