This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ZooIF { | |
| public: | |
| virtual void EnterZooEarly(ZooPatron * patron) = 0; | |
| virtual void AttendAnimalShow(ZooPatron * patron) = 0; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ZooPatron { | |
| public: | |
| ZooPatron(std::string name) | |
| : m_name(name) {} | |
| virtual ~ZooPatron() {} | |
| std::string GetName() { return m_name; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ZooGuest::ZooGuest(std::string name) | |
| : ZooPatron(name) | |
| { | |
| } | |
| ZooGuest::~ZooGuest() { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ZooGuest : public ZooPatron { | |
| public: | |
| ZooGuest(std::string name); | |
| virtual ~ZooGuest(); | |
| virtual bool HasAnimalShowAccess() | |
| { | |
| return false; | |
| } | |
| virtual bool HasEarlyAccess() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ZooMember::ZooMember(std::string name) | |
| : ZooPatron(name) { | |
| } | |
| ZooMember::~ZooMember() { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ZooMember : public ZooPatron { | |
| public: | |
| ZooMember(std::string name); | |
| virtual ~ZooMember(); | |
| virtual bool HasAnimalShowAccess() | |
| { | |
| return true; | |
| } | |
| virtual bool HasEarlyAccess() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int main() | |
| { | |
| MusicPlayer player; | |
| player.Play(); | |
| player.Pause(); | |
| player.Stop(); | |
| return 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| StoppedState::StoppedState() | |
| : MusicPlayerState(std::string("Stopped")) { | |
| } | |
| StoppedState::~StoppedState() { | |
| } | |
| void StoppedState::Play(MusicPlayer * player) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class StoppedState : public MusicPlayerState { | |
| public: | |
| StoppedState(); | |
| virtual ~StoppedState(); | |
| virtual void Play(MusicPlayer * player); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PausedState::PausedState() | |
| : MusicPlayerState(std::string("Paused")) { | |
| } | |
| PausedState::~PausedState() { | |
| } | |
| void PausedState::Play(MusicPlayer * player) | |
| { |