Cockatrice/cockatrice/src/game/player/player_area.h
2026-05-21 22:58:07 +02:00

52 lines
1.1 KiB
C++

/**
* @file player_area.h
* @ingroup GameGraphicsPlayers
*/
//! \todo Document this file.
#ifndef COCKATRICE_PLAYER_AREA_H
#define COCKATRICE_PLAYER_AREA_H
#include "../../game_graphics/board/graphics_item_type.h"
#include "QGraphicsItem"
/**
* The entire graphical area belonging to a single player.
*/
class PlayerArea : public QObject, public QGraphicsItem
{
Q_OBJECT
Q_INTERFACES(QGraphicsItem)
private:
QRectF bRect;
int playerZoneId;
private slots:
void updateBg();
public:
enum
{
Type = typeOther
};
[[nodiscard]] int type() const override
{
return Type;
}
explicit PlayerArea(QGraphicsItem *parent = nullptr);
[[nodiscard]] QRectF boundingRect() const override
{
return bRect;
}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
void setSize(qreal width, qreal height);
void setPlayerZoneId(int _playerZoneId);
[[nodiscard]] int getPlayerZoneId() const
{
return playerZoneId;
}
};
#endif // COCKATRICE_PLAYER_AREA_H