diff options
Diffstat (limited to 'src/crepe/manager/Mediator.h')
-rw-r--r-- | src/crepe/manager/Mediator.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/crepe/manager/Mediator.h b/src/crepe/manager/Mediator.h index ce35d5c..842f1de 100644 --- a/src/crepe/manager/Mediator.h +++ b/src/crepe/manager/Mediator.h @@ -2,14 +2,17 @@ #include "../util/OptionalRef.h" -// TODO: remove these singletons: -#include "SaveManager.h" -#include "EventManager.h" - namespace crepe { class ComponentManager; class SceneManager; +class EventManager; +class LoopTimerManager; +class SaveManager; +class ResourceManager; +class SDLContext; +class ReplayManager; +class SystemManager; /** * Struct to pass references to classes that would otherwise need to be singletons down to @@ -17,13 +20,22 @@ class SceneManager; * pass specific references through dependency injection. All references on this struct * *should* be explicitly checked for availability as this struct does not guarantee anything. * - * \todo Find better solution + * \note Dereferencing members of this struct should be deferred. If you are a user of this + * class, keep a reference to this mediator instead of just picking references from it when you + * receive an instance. + * + * \warning This class should never be directly accessible from the API */ struct Mediator { + OptionalRef<SDLContext> sdl_context; OptionalRef<ComponentManager> component_manager; OptionalRef<SceneManager> scene_manager; - OptionalRef<SaveManager> save_manager = SaveManager::get_instance(); - OptionalRef<EventManager> event_manager = EventManager::get_instance(); + OptionalRef<EventManager> event_manager; + OptionalRef<LoopTimerManager> loop_timer; + OptionalRef<SaveManager> save_manager; + OptionalRef<ResourceManager> resource_manager; + OptionalRef<ReplayManager> replay_manager; + OptionalRef<SystemManager> system_manager; }; -} +} // namespace crepe |