mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 16:13:54 -07:00
54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
/**
|
|
* @file player_target.h
|
|
* @ingroup GameGraphicsPlayers
|
|
*/
|
|
//! \todo Document this file.
|
|
|
|
#ifndef PLAYERTARGET_H
|
|
#define PLAYERTARGET_H
|
|
|
|
#include "../../game_graphics/board/graphics_item_type.h"
|
|
#include "../board/abstract_counter.h"
|
|
#include "../board/arrow_target.h"
|
|
|
|
#include <QPixmap>
|
|
|
|
class PlayerLogic;
|
|
|
|
class PlayerCounter : public AbstractCounter
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
PlayerCounter(CounterState *state, PlayerLogic *player, QGraphicsItem *parent);
|
|
QRectF boundingRect() const override;
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
|
};
|
|
|
|
class PlayerTarget : public ArrowTarget
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
QPixmap fullPixmap;
|
|
PlayerCounter *playerCounter;
|
|
public slots:
|
|
void counterDeleted();
|
|
|
|
public:
|
|
enum
|
|
{
|
|
Type = typePlayerTarget
|
|
};
|
|
int type() const override
|
|
{
|
|
return Type;
|
|
}
|
|
|
|
explicit PlayerTarget(PlayerLogic *_player = nullptr, QGraphicsItem *parentItem = nullptr);
|
|
~PlayerTarget() override;
|
|
QRectF boundingRect() const override;
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
|
|
|
AbstractCounter *addCounter(CounterState *state);
|
|
};
|
|
|
|
#endif
|