diff options
Added work from today's practice
1 files changed, 15 insertions, 0 deletions
| -rw-r--r-- | Year 1/Object-oriented Programming/12-Practice-17.05.2022/ex1/PremiumPlayer.h | 15 |
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; + } +}; |
