-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.hpp
55 lines (41 loc) · 1021 Bytes
/
Player.hpp
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
#pragma once
#include "Bet.hpp"
#include <iostream>
#include <stdexcept>
#include <string>
namespace Bet
{
class Bet;
}
namespace Player
{
using namespace std;
class Player
{
private:
float Money;
string Name;
vector<Bet::Bet*>* Bets;
vector<Hand::Hand*>* Hands;
public:
Player() : Name("Player"), Money(0), Bets(new vector<Bet::Bet*>()), Hands(new vector<Hand::Hand*>()) {}
Player(float money, string name) : Name(name), Money(money), Bets(new vector<Bet::Bet*>()), Hands(new vector<Hand::Hand*>())
{
if (money < 0)
throw new runtime_error("Money can't be less than 0!");
if (name.size() < 1)
throw new runtime_error("Name can't be empty!");
}
float GetMoney();
vector<Bet::Bet*>* GetBets();
void Deposite(float deposite);
bool CanDeposite(float deposite);
void Withdrawal(float withdrawal);
bool CanWithdrawal(float withdrawal);
void GiveBet(Bet::Bet* bet);
string GetName();
void AddHand(Hand::Hand* hand);
void ClearHands();
~Player();
};
}