-
Notifications
You must be signed in to change notification settings - Fork 0
/
FinalStack.h
42 lines (33 loc) · 1.13 KB
/
FinalStack.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
// Author: Annie Berend (5033782) - Jonathan Verbeek (5058288)
#pragma once
#include <QObject>
#include "CardStack.h"
#include "CardVBoxLayout.h"
// Represents one of the four final card stacks at the top of the game,
// where cards get dropped off until the stack is full
class CFinalStack : public CCardStack
{
Q_OBJECT
public:
// How many cards to render on a final stack to avoid glitches with the shadows
static int NumCardsToRender;
public:
// Constructor
CFinalStack(QWidget* parent = nullptr, ECardSymbol symbol = ECardSymbol::Heart);
public:
//~ Begin CCardStack interface
virtual void addCard(CCard *cardToAdd) override;
virtual void removeCard(CCard *cardToRemove) override;
virtual bool canDropCard(CCard* cardToDrop) override;
virtual void handleCardsChanged() override;
//~ End CCardCard interface
private:
// Overwritten drag'n'drop events
void dragEnterEvent(QDragEnterEvent* ev) override;
void dropEvent(QDropEvent* ev) override;
private:
// The symbol this final stack allows
ECardSymbol stackSymbol;
// Box layout to display the cards
CCardVBoxLayout* vbox;
};