-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHoldingStack.h
52 lines (40 loc) · 1.44 KB
/
HoldingStack.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Author: Annie Berend (5033782) - Jonathan Verbeek (5058288)
#pragma once
#include <QObject>
#include <QWidget>
#include "CardStack.h"
#include "CardVBoxLayout.h"
// The holding stack is a card stack which renders the cards below each other
class CHoldingStack : public CCardStack
{
Q_OBJECT
public:
// Constructor
CHoldingStack(QWidget* parent = nullptr);
public:
// The offset in pixels to apply between each card
static int CardOffsetInStack;
// The offset in pixels to apply between each card when making the stack smaller
static int CardOffsetInStackSmaller;
// The amount of cards to allow per holding stack before collapsing them
static int StackCollapseNumCards;
public:
//~ Begin CCardStack interface
virtual void addCard(CCard *cardToAdd) override;
virtual void removeCard(CCard *cardToRemove) override;
virtual bool canDropCard(CCard* cardToDrop) override;
//~ End CCardCard interface
// Flips the next top card
void flipNextCard();
// Returns all cards above a specific card
QList<CCard*> getCardsAbove(CCard* card);
private:
// Overwritten drag'n'drop events
void dragEnterEvent(QDragEnterEvent* ev) override;
void dropEvent(QDropEvent* ev) override;
// Checks (and potentially performs) whether to collapse this stack or not
void checkCollapseStack();
private:
// The vertical box layout to use for the holding stack
CCardVBoxLayout* vbox;
};