-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclass_gambler.h
61 lines (42 loc) · 1.2 KB
/
class_gambler.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
#ifndef CLASS_GAMBLER_H
#define CLASS_GAMBLER_H
#include <vector>
//Local includes
#include "class_strategy.h"
#include "class_action.h"
#include "class_game.h"
namespace casino{
//Forward declaration - WHY?
class game;
typedef enum{TERMINAL,NETWORK,GUI,COMPUTER} controlType;
typedef float cash;
//class player? If dealer is very similar to a gambler
class gambler{
static int gamblerNr;
int gamblerId;
//Indicate if the player can be used in a game, or too busy
bool readyToPlay;
//Is float safe for this purpouse?
//Use int if rounding is an issue
cash wallet;
std::string firstName,lastName;
std::vector<strategy*> strategies;
public:
gambler(std::string fname,std::string lname);
gambler(controlType=TERMINAL);
//Put money in wallet
void giveMoney(cash amount);
std::string name();
//getter for readyToPlay
bool ready();
//Make an in-game decision based on gameState
action* takeAction(gameState* g);
//Join a game.
//Might set readyToPlay=0
//Why not just call takeAction?
void joinGame(game& g);
// - To set currentGame?
// - To ...?
};
}
#endif