SDEngine
Game Engine
Loading...
Searching...
No Matches
SceneManager.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5
6#include "SD/arena.hpp"
7#include "SD/export.hpp"
8
9
10namespace sd {
11
12struct Scene;
13
15 Scene* create(Arena* arena, const std::string& name);
16 Scene* get(const std::string& name) const;
17
18 template<typename F>
19 void for_each(F&& fn) {
20 for (auto* scene : m_scenes) {
21 fn(*scene);
22 }
23 }
24
25 template<typename F>
26 void for_each(F&& fn) const {
27 for (const auto* scene : m_scenes) {
28 fn(*scene);
29 }
30 }
31
32 void clear();
33
34 std::vector<Scene*> m_scenes;
35};
36
37} // namespace sd
Definition Application.hpp:22
Definition arena.hpp:85
Definition SceneManager.hpp:14
void for_each(F &&fn) const
Definition SceneManager.hpp:26
void for_each(F &&fn)
Definition SceneManager.hpp:19
std::vector< Scene * > m_scenes
Definition SceneManager.hpp:34
Definition Scene.hpp:9
consteval U64 type_id_of()
Definition type_id.hpp:6