Website Summary Files Commits Branches @commit @diff @stats
path: root / pract KN / week7 / solution / player.h
blob: 4c197df74306b7f99565121cb412df2f05eaa00d (plain) (blame)
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
#ifndef PLAYER_HEADER
#define PLAYER_HEADER
#include"betType.h"

#pragma warning(disable : 4996)

class player {
private:
	char* name;
	char* password;
	int age;
	double money;

	void free();

	void copy(const player& other);

	void showHelp() const;

public:
	player() : name(nullptr), password(nullptr), age(0), money(0) {}

	player(const char* name,const char* pass, int age, double money);

	player(const player& other);

	player& operator=(const player& other);

	void setName(const char* newName);

	void setAge(int newAge);

	const char* getName() const;

	void changePassword(const char* newPass, const char* oldPass);

	void updateMoney(double bet, double rate);

	int getAge() const;

	double getMoney() const;

	bool isBroke() const;

	bool comparePassword(const char* pwd) const;

	betType makeBet() const;

	~player();
};

#endif