aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/manager/Mediator.h
blob: ce35d5c4c43ec774242a891c0d705c78864d1a31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once

#include "../util/OptionalRef.h"

// TODO: remove these singletons:
#include "SaveManager.h"
#include "EventManager.h"

namespace crepe {

class ComponentManager;
class SceneManager;

/**
 * Struct to pass references to classes that would otherwise need to be singletons down to
 * other classes within the engine hierarchy. Made to prevent constant changes to subclasses to
 * 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
 */
struct Mediator {
	OptionalRef<ComponentManager> component_manager;
	OptionalRef<SceneManager> scene_manager;
	OptionalRef<SaveManager> save_manager = SaveManager::get_instance();
	OptionalRef<EventManager> event_manager = EventManager::get_instance();
};

}