Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / 07-Practice-05.04.2022 / Player.h
blob: 2001c2baae164f1c4aa11c87cccfaf091a521cc4 (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
#ifndef PLAYER_HEADER
#define PLAYER_HEADER

class Player {
	char* name;
	char* pass;
	unsigned age;
	double balance;

	void copyFrom(const Player&);
	void free() const;

	bool isValidPassword(const char*);
public:
	Player(const char*, const char*, unsigned, double);

	Player(const Player&);
	Player& operator=(const Player&);
	~Player();

	const char* get_name() const;
	bool set_name(const char*, const char*);

	bool set_password(const char*, const char*);

	unsigned get_age() const;
	bool set_age(const char*, unsigned value);

	double get_balance() const;
	bool addToBalance(const char*, double);
	bool deductFromBalance(const char*, double);
};

#endif