Nymph Game Engine
Chaiscript based Game Engine
|
Class for a subject that an observer would observe for changes. More...
#include <subject.h>
Public Member Functions | |
virtual | ~Subject ()=default |
virtual void | notify (std::shared_ptr< Event > event) |
notify is used to tell observers of an event. More... | |
virtual void | notifyNow (std::shared_ptr< Event > event) |
notifyNow is used to tell observers of an event as an interrupt. More... | |
virtual void | addObserver (std::shared_ptr< Observer > observer) |
Adds an observer. More... | |
virtual void | removeObserver (std::shared_ptr< Observer > observer) |
Removes an observer. More... | |
Class for a subject that an observer would observe for changes.
|
virtualdefault |
|
virtual |
|
virtual |
notify is used to tell observers of an event.
[in] | event | The event |
Referenced by Game::SpriteMovementMotor::MoveUpReactor::enterState(), Game::SpriteMovementMotor::MoveDownReactor::enterState(), Game::SpriteMovementMotor::MoveLeftReactor::enterState(), Game::SpriteMovementMotor::MoveRightReactor::enterState(), generated::getSubjectModule(), Graphics::Camera::onStart(), Graphics::TileAnimator< StateType >::onStart(), Graphics::Camera::onUpdate(), Utility::DebugParser::parseCommand(), and Input::InputSystem::pollForInput().
|
virtual |
notifyNow is used to tell observers of an event as an interrupt.
[in] | event | The event |
Referenced by Utility::FPSCounter::assessCountAndGetDelta(), Game::SpriteMovementMotor::MoveUpReactor::enterState(), Game::SpriteMovementMotor::FaceUpReactor::enterState(), Game::SpriteMovementMotor::MoveDownReactor::enterState(), Game::SpriteMovementMotor::FaceDownReactor::enterState(), Game::SpriteMovementMotor::MoveLeftReactor::enterState(), Game::SpriteMovementMotor::FaceLeftReactor::enterState(), Game::SpriteMovementMotor::MoveRightReactor::enterState(), Game::SpriteMovementMotor::FaceRightReactor::enterState(), generated::getSubjectModule(), Graphics::UI::TextField::onKeyDown(), Graphics::UI::QuitButton::onLeftClick(), Graphics::UI::TextField::onLeftClick(), and Graphics::TileAnimator< StateType >::onUpdate().
|
virtual |
Removes an observer.
[in] | observer | The observer |
Referenced by generated::getSubjectModule().