Skip to content

Instantly share code, notes, and snippets.

@branislav1991
Created June 15, 2022 17:29
Show Gist options
  • Save branislav1991/e04f27e1123fb3cddf6aad01f1bce1e7 to your computer and use it in GitHub Desktop.
Save branislav1991/e04f27e1123fb3cddf6aad01f1bce1e7 to your computer and use it in GitHub Desktop.
class Door
{
public:
Door() {}
void interact()
{
// 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