Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / 12-Practice-17.05.2022 / ex1 / PremiumPlayer.h
diff options
context:
space:
mode:
1 files changed, 15 insertions, 0 deletions
-rw-r--r--Year 1/Object-oriented Programming/12-Practice-17.05.2022/ex1/PremiumPlayer.h15
diff --git a/Year 1/Object-oriented Programming/12-Practice-17.05.2022/ex1/PremiumPlayer.h b/Year 1/Object-oriented Programming/12-Practice-17.05.2022/ex1/PremiumPlayer.h
new file mode 100644
index 0000000..0c8e9e1
--- /dev/null
+++ b/Year 1/Object-oriented Programming/12-Practice-17.05.2022/ex1/PremiumPlayer.h
@@ -0,0 +1,15 @@
+#include "LoggedInPlayer.h"
+
+class PremiumPlayer : public LoggedInPlayer {
+ char name[1024];
+
+public:
+ bool levelUp() {
+ bool can = points >= 256;
+ if (can) {
+ points -= 256;
+ star = (Star)(star << 1);
+ }
+ return can;
+ }
+};