-
Notifications
You must be signed in to change notification settings - Fork 0
/
Table.h
71 lines (62 loc) · 1.61 KB
/
Table.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#include "Player.h"
#include "Dealer.h"
#include <vector>
using std::cout;
using std::cin;
using std::vector;
using std::endl;
class Table
{
private:
vector<Player> playerList; // total player on the table
vector<Player> activeList;
vector<int> cardDeck;
int tableSize;
int blindSize;
Dealer dealer; // when is this created?
public:
Table() {
// cin for tableSize and blindSize
cout << "Please enter the number of players on the table: ";
cin >> this->tableSize;
cout << "Please enter the size of small blind: ";
cin >> this->blindSize;
cout << "The number of players on the table are: " << tableSize << endl;
cout << "The blinds are " << blindSize << "/" << blindSize * 2 << endl;
// create dealer and deals card
cardDeck = dealer.dealCards(tableSize);
// construc the players and add them to PlayerList
int chip;
char name[32];
int hash1;
int hash2;
for (int i = 0; i < tableSize; i++) {
cout << "Please enter your name (max lenghth 32): ";
cin >> name;
cout << "Please enter your buy-in amount: ";
cin >> chip;
hash1 = cardDeck.back();
cardDeck.pop_back();
hash2 = cardDeck.back();
cardDeck.pop_back();
playerList.push_back(Player(hash1, hash2, chip, name));
}
assignBlind();
/*
for (int i = 0; i < tableSize; i++) {
cerr << "PlayerList at index " << i << " is " << playerList[i] << endl;
cerr << "active at index " << i << " is " << activeList[i] << endl;
}*/
}
// main sequences
void pre();
void flop();
void turn();
void river();
void finish();
// helpers
void resizeTable();
void resizeBlind();
void assignBlind();
};