From ff171c3bc508e4a82e2329c550532f60a8be2e38 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 17 May 2022 21:14:55 +0300 Subject: Added work from today's practice --- .../12-Practice-17.05.2022/ex1/PremiumPlayer.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Year 1/Object-oriented Programming/12-Practice-17.05.2022/ex1/PremiumPlayer.h (limited to 'Year 1/Object-oriented Programming/12-Practice-17.05.2022/ex1/PremiumPlayer.h') 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; + } +}; -- cgit v1.3.1-26-gb76a