From b68542a9ffa71c51a7481df8fa12e7fc41c7ab77 Mon Sep 17 00:00:00 2001 From: Stoycho Kyosev <68247567+stoychoX@users.noreply.github.com> Date: Wed, 6 Apr 2022 16:36:40 +0300 Subject: Add files via upload --- pract KN/week7/solution/player.h | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 pract KN/week7/solution/player.h (limited to 'pract KN/week7/solution/player.h') diff --git a/pract KN/week7/solution/player.h b/pract KN/week7/solution/player.h new file mode 100644 index 0000000..134e0d6 --- /dev/null +++ b/pract KN/week7/solution/player.h @@ -0,0 +1,54 @@ +#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; + + char* copyDynamic(const char* arg) 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 -- cgit v1.3.1-23-gd82d