-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgambler.h
More file actions
49 lines (38 loc) · 1.24 KB
/
gambler.h
File metadata and controls
49 lines (38 loc) · 1.24 KB
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
#ifndef CASINO_GAMBLER_H
#define CASINO_GAMBLER_H
#include "betting_strategy.h"
#include "logger.h"
#include "pub_sub.h"
#include "wheel.h"
namespace casino {
namespace gambler {
class Gambler : public pub_sub::Subscriber {
private:
int myGamblerID;
// TODO: can we decouple gambler and wheel? first think why should we do that?
wheel::Wheel* myWheel;
logger::Logger myLogger;
double myMoney;
betting_strategy::Strategy* myStrategy;
bool do_auto_betting;
static int GAMBLER_COUNT;
void account_win(pub_sub::Event e);
std::string log_prefix();
std::string log_prefix(std::string);
public:
Gambler(betting_strategy::Strategy*, wheel::Wheel*);
void start_subscription();
void stop_subscription();
void start_auto_betting();
void stop_auto_betting();
void accept(pub_sub::Event e);
/**
* Places a bet with the given amt on the given number.
* If amt is <= 0 then any bet placed by this gambler on that number is reset.
*/
void place_bet(betting_strategy::t_bet);
void auto_place_bet();
};
} // namespace gambler
} // namespace casino
#endif // CASINO_GAMBLER_H