-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDealer.cpp
More file actions
44 lines (31 loc) · 755 Bytes
/
Dealer.cpp
File metadata and controls
44 lines (31 loc) · 755 Bytes
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
#include <iostream>
#include "Dealer.h"
//Constructor
Dealer::Dealer() {
for (int i = 0; i < PLAYERS; i++) {
std::string newName = _NAME_TABLE[i];
_players.emplace_back(Player(newName));
}
_deck = Deck();
}
//Function to distribute cards.
void Dealer::distribute() {
_deck.Shuffle();
for (int i = 0; i < NUMBER_OF_CARDS; i++) {
for (Player &player: _players) {
Card card = _deck.getCard();
player.AddCard(card);
}
}
}
//Game controller Function
void Dealer::StartGame() {
this->distribute();
for (Player &player: _players) {
player.ToString();
}
}
//Function non terminer
void Dealer::getWinner() {
Player selectedWinner = _players[0];
}