Website Summary Files Commits Branches @commit @diff @stats
path: root / pract KN / week7 / solution / player.h
diff options
context:
space:
mode:
Commit84fc9e2c75a19c580487d763362cbf220d7a0b95 (patch)
Author
 Stoycho Kyosev <68247567+stoychoX@users.noreply.github.com>
2022-04-06 16:45:48 +0300
Committer
 GitHub <noreply@github.com>
2022-04-06 16:45:48 +0300
Filese82ef7dad0ed34d8383b9e9677cb96b71e156478 /pract KN/week7/solution/player.h
Object-oriented_programming_FMI-84fc9e2c75a19c580487d763362cbf220d7a0b95.tar
Object-oriented_programming_FMI-84fc9e2c75a19c580487d763362cbf220d7a0b95.tar.gz
Object-oriented_programming_FMI-84fc9e2c75a19c580487d763362cbf220d7a0b95.zip
Parentaf6df8ee13421602442ede2cfab52dd70788b588 (diff)
Add files via upload
1 files changed, 52 insertions, 0 deletions
-rw-r--r--pract KN/week7/solution/player.h52
diff --git a/pract KN/week7/solution/player.h b/pract KN/week7/solution/player.h
new file mode 100644
index 0000000..4c197df
--- /dev/null
+++ b/pract KN/week7/solution/player.h
@@ -0,0 +1,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