JustEnoughMod
Loading...
Searching...
No Matches
Application.hpp
1#ifndef CORE_APPLICATION_HPP
2#define CORE_APPLICATION_HPP
3
4#include <core/Window.hpp>
5#include <event/EventManager.hpp>
6#include <plugin/PluginLoader.hpp>
7#include <render/Renderer.hpp>
8#include <sched/TaskManager.hpp>
9
10#include <memory>
11
12namespace JEM {
13 class Application : public std::enable_shared_from_this<Application> {
14 public:
15 void init(char *path);
17
18 void run();
19
20 [[nodiscard]] static constexpr auto getAppVersion() -> Version {
21#ifdef VERSION
22 return Version(VERSION);
23#else
24 return Version("0.0.0");
25#endif
26 }
27
28 [[nodiscard]] auto getWindow() const -> std::shared_ptr<Window> {
29 return m_window;
30 }
31
32 [[nodiscard]] auto getRenderer() const -> std::shared_ptr<Renderer> {
33 return m_renderer;
34 }
35
36 [[nodiscard]] auto getPluginLoader() const -> std::shared_ptr<Plugin::PluginLoader> {
37 return m_pluginLoader;
38 }
39
40 [[nodiscard]] auto getEventManager() const -> std::shared_ptr<EventManager> {
41 return m_eventManager;
42 }
43
44 private:
45 std::shared_ptr<Window> m_window;
46 std::shared_ptr<Renderer> m_renderer;
47 std::shared_ptr<Plugin::PluginLoader> m_pluginLoader;
48 std::shared_ptr<EventManager> m_eventManager;
49 std::shared_ptr<TaskManager> m_taskManager;
50
51 bool m_quit{};
52 };
53} // namespace JEM
54
55#endif
Definition Application.hpp:13
Definition Version.hpp:9