meta_system.hpp 2.6 KB
Newer Older
1 2 3 4 5 6
#pragma once

#include <mirrage/ecs/ecs.hpp>
#include <mirrage/gui/debug_ui.hpp>
#include <mirrage/utils/units.hpp>

Georg Schäfer's avatar
Georg Schäfer committed
7
#include <audio.hpp>
8
#include <sinks/sdl_sink.hpp>
9 10 11 12 13 14 15 16 17 18 19 20 21 22

namespace mirrage {
	namespace renderer {
		class Deferred_renderer;
	}
	namespace renderer {
		class Loading_system;
	}
} // namespace mirrage


namespace phase_shifter {
	class Game_engine;

Florian Oetke's avatar
Florian Oetke committed
23 24 25
	namespace audio {
		class Sound_manager;
	}
Florian Oetke's avatar
Florian Oetke committed
26 27
	namespace gameplay {
		class Beat_system;
Florian Oetke's avatar
Florian Oetke committed
28
		class Movement_system;
29
		class Camera_system;
30
		class Enemy_system;
31
		class Combat_system;
Kevin Balz's avatar
Dash  
Kevin Balz committed
32
		class Dash_system;
Kevin Balz's avatar
Kevin Balz committed
33
		class Stationary_attack_system;
Florian Oetke's avatar
Florian Oetke committed
34
	} // namespace gameplay
35 36 37
	namespace helper {
		class Attachment_system;
	}
Florian Oetke's avatar
Florian Oetke committed
38 39 40
	namespace input {
		class Input_system;
	}
41
	namespace ui {
42
		class Effect_system;
43
		class Hud_system;
44
	} // namespace ui
Georg Schäfer's avatar
Georg Schäfer committed
45 46 47
	namespace level {
		class Level_system;
	}
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63

	class Meta_system {
	  public:
		Meta_system(Game_engine&);
		~Meta_system();

		void update(mirrage::util::Time dt);
		void draw();

		void pause();
		void resume();

		void shrink_to_fit();

		auto entities() noexcept -> auto& { return _entities; }
		auto renderer() noexcept -> auto& { return *_renderer; }
Georg Schäfer's avatar
Georg Schäfer committed
64
		auto level_system() noexcept -> auto& { return *_level_system; }
65 66 67 68 69

	  private:
		mirrage::ecs::Entity_manager                          _entities;
		std::unique_ptr<mirrage::renderer::Deferred_renderer> _renderer;
		std::unique_ptr<mirrage::renderer::Loading_system>    _model_loading;
Florian Oetke's avatar
Florian Oetke committed
70
		std::unique_ptr<audio::Sound_manager>                 _sound_manager;
71

Georg Schäfer's avatar
Georg Schäfer committed
72 73 74 75 76 77 78 79 80 81
		std::unique_ptr<gameplay::Beat_system>              _beat_system;
		std::unique_ptr<level::Level_system>                _level_system;
		std::unique_ptr<gameplay::Movement_system>          _movement_system;
		std::unique_ptr<input::Input_system>                _input_system;
		std::unique_ptr<gameplay::Combat_system>            _combat_system;
		std::unique_ptr<helper::Attachment_system>          _attachment_system;
		std::unique_ptr<ui::Hud_system>                     _hud_system;
		std::unique_ptr<gameplay::Camera_system>            _camera_system;
		std::unique_ptr<gameplay::Enemy_system>             _enemy_system;
		std::unique_ptr<gameplay::Dash_system>              _dash_system;
Kevin Balz's avatar
Kevin Balz committed
82
		std::unique_ptr<gameplay::Stationary_attack_system> _stationary_attack_system;
Georg Schäfer's avatar
Georg Schäfer committed
83 84 85 86
		std::unique_ptr<ui::Effect_system>                  _effect_system;
		std::shared_ptr<eam::context>                       _music;
		bool                                                _first_frame = true;
		bool                                                _play_music  = false;
87 88 89

		mirrage::util::Console_command_container _commands;
	};
Florian Oetke's avatar
Florian Oetke committed
90
} // namespace phase_shifter