Created
June 15, 2022 16:36
-
-
Save branislav1991/bf5b9eff66056182a6854d1215503915 to your computer and use it in GitHub Desktop.
This file contains 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 Door : public InteractiveObject | |
{ | |
public: | |
Door() {} | |
void interact() override | |
{ | |
// Open or close the door | |
m_open = !m_open; | |
if (m_open) | |
{ | |
std::cout << "Door is open" << std::endl; | |
} | |
else | |
{ | |
std::cout << "Door is closed" << std::endl; | |
} | |
} | |
private: | |
bool m_open = false; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment