Abstract base class for all Malena managers. More...
#include <Manager.h>
Public Member Functions | |
| virtual | ~Manager ()=default |
| virtual void | draw ()=0 |
| Render the subsystem's visual output to the window. | |
| virtual void | fireInputEvents (const std::optional< sf::Event > &event)=0 |
| Distribute an SFML input event to this subsystem. | |
| virtual void | fireUpdateEvents ()=0 |
| Fire the per-frame update event across all subscribers. | |
| virtual void | run ()=0 |
| Execute subsystem-specific per-frame work. | |
Abstract base class for all Malena managers.
A Manager is responsible for driving one subsystem through the application main loop. Every concrete manager must implement the four lifecycle steps that AppManager calls each frame:
fireInputEvents — distribute the current SFML event to the subsystemfireUpdateEvents — perform per-frame logic updatesrun — execute any subsystem-specific per-frame workdraw — render the subsystem's output to the windowManagers are typically statically allocated singletons (e.g., EventsManager, ComponentsManager) rather than instances passed around by pointer, but the interface is expressed as a virtual class so that AppManager can hold a heterogeneous list of registered managers.
|
virtualdefault |
|
pure virtual |
Render the subsystem's visual output to the window.
Called once per frame after run(). Implementations should call window.draw() on any objects this manager is responsible for drawing.
|
pure virtual |
Distribute an SFML input event to this subsystem.
Called once per frame for each event returned by sf::Window::pollEvent. Managers that respond to keyboard, mouse, or window events process them here.
| event | The SFML event, wrapped in std::optional. An empty optional indicates the end of the event queue (i.e., the update-only tick). |
|
pure virtual |
Fire the per-frame update event across all subscribers.
Called once per frame after all input events have been processed. Use this to drive animation, polling, or any time-based logic.
|
pure virtual |
Execute subsystem-specific per-frame work.
Provides an additional hook beyond fireUpdateEvents for managers that need to perform internal bookkeeping separate from event distribution.
Implemented in ml::AppManager.