-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.h
38 lines (32 loc) · 838 Bytes
/
player.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
#ifndef PLAYER_H
#define PLAYER_H
#include <QTimer>
#include <QGridLayout>
#include <QSoundEffect>
#include <QPropertyAnimation>
#include "deck.h"
#include "card.h"
class Player
{
public:
Player(QWidget* parent, std::shared_ptr<Deck> deck);
virtual void hit();
virtual ~Player() = default;
void Init();
int getScore();
void addScore(const Card& card);
int getBalance() const;
void Reset();
void setBalance(int newBalance);
protected:
int score;
int balance;
int ace_count;
QList<Card> taken_cards;
std::shared_ptr<Deck> common_deck;
std::unique_ptr<QPropertyAnimation> animation;
QSoundEffect card_sound;
private:
const QPoint player_deck_pos = QPoint(200,300); //it's where first card will be placed and acordingly next ones will be in line
};
#endif // PLAYER_H