-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbjDeck.h
56 lines (33 loc) · 1.22 KB
/
bjDeck.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
53
54
55
56
//Topic 13: Object Orientation: Inheritance
#ifndef CCPP_EXAM_BJDECK_H
#define CCPP_EXAM_BJDECK_H
#include <vector>
#include <algorithm>
#include "bjCards.h"
#include <cstdio>
#include <memory>
class bjDeck {
private:
//Topic 26: Häufige fehlerquellen -> keine Uninitialisierten variablen
//Topic 21: wichtige Container der C++-Standardbibliothek
//Topic 28: smart pointers
std::vector<std::shared_ptr<bjCards>> deck;
int cardCounter;
//Topic 21: wichtige Container der C++-Standardbibliothek
//Topic 28: smart pointers
std::vector<std::shared_ptr<bjCards>> playedCards;
void reduceCardCounter();
std::string numberList[13] = {"2", "3", "4", "5", "6", "7", "8", "9", "10", "B", "D", "K", "A"};
void setCardCounter(int i);
std::string getNumberX(int x);
void deckShuffel();
public:
void addCardtoDeck(const std::shared_ptr<bjCards> &card);
std::vector<std::shared_ptr<bjCards>> getDeck();
std::shared_ptr<bjCards> playFirstCardFromStack();
void generatePlayCardsAndAddtoDeck(int maxDecks);
int getTotalValue();
void reshuffelIfNeeded(int trigger);
void collectPlayedCards(const std::shared_ptr<bjCards> &card);
};
#endif //CCPP_EXAM_BJDECK_H