-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.h
48 lines (44 loc) · 961 Bytes
/
controller.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
#ifndef _CONTROLLER_H_
#define _CONTROLLER_H_
#include <vector>
#include <memory>
#include <fstream>
#include <iostream>
#include <sstream>
#include <typeinfo>
#include "deck.h"
#include "table.h"
#include "player.h"
#include "computerplayer.h"
#include "humanplayer.h"
#include "testmanager.h"
class Controller {
std::vector<std::shared_ptr<Player>> players;
std::shared_ptr<Table> table;
std::shared_ptr<Deck> deck;
unsigned int seed;
int curPlayer;
bool gameOver;
public:
Controller(unsigned int seed = 0);
void setPreviousState(std::ifstream & inf);
void invitePlayers();
void startRound();
void playerTurn();
void setNextPlayer();
void endRound();
bool roundOver();
void rageQuit();
void clearGame();
bool getGameOver() const;
int getCurPlayer();
// For Testing Purposes
// friend class TestManager;
private:
void dealCards();
void checkWinner();
void getWinner();
void humanPlayerMove();
void computerPlayerMove();
};
#endif