mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 11:03:54 -07:00
52 lines
1.1 KiB
C++
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
|