mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-06 13:33:55 -07:00
[Game/Zones] Simple move refactor to differentiate between logic and graphics for zones (#6903)
* [Game/Zones] Simple move refactor to differentiate between logic and graphics for zones Took 21 minutes * Clean up game/zones/logic folder. Took 6 minutes * Adjust tests. Took 3 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
bb1a5b33a1
commit
cba9ce2b2b
47 changed files with 107 additions and 107 deletions
32
cockatrice/src/game_graphics/zones/stack_zone.h
Normal file
32
cockatrice/src/game_graphics/zones/stack_zone.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/**
|
||||
* @file stack_zone.h
|
||||
* @ingroup GameGraphicsZones
|
||||
* @brief Graphical zone for the stack, displaying cards in a vertical pile.
|
||||
*/
|
||||
|
||||
#ifndef STACKZONE_H
|
||||
#define STACKZONE_H
|
||||
|
||||
#include "../../game/zones/stack_zone_logic.h"
|
||||
#include "select_zone.h"
|
||||
|
||||
class StackZone : public SelectZone
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
qreal zoneHeight;
|
||||
private slots:
|
||||
void updateBg();
|
||||
|
||||
public:
|
||||
StackZone(StackZoneLogic *_logic, int _zoneHeight, QGraphicsItem *parent);
|
||||
/// @brief Resizes the stack zone height, e.g. when sharing vertical space with the command zone.
|
||||
void setHeight(qreal newHeight);
|
||||
void
|
||||
handleDropEvent(const QList<CardDragItem *> &dragItems, CardZoneLogic *startZone, const QPoint &dropPoint) override;
|
||||
QRectF boundingRect() const override;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||
void reorganizeCards() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue