CoriEngine
Loading...
Searching...
No Matches
SceneManager.hpp
Go to the documentation of this file.
1#pragma once
2#include "SceneHandle.hpp"
3
4namespace Cori {
5 namespace Core {
6 class Application;
7 }
8
9 namespace World {
14 public:
21 [[nodiscard]] static std::expected<SceneHandle, Core::CoriError<>> CreateScene(const std::string& name);
22
28 [[nodiscard]] static std::expected<SceneHandle, Core::CoriError<>> GetScene(const std::string& name);
29
35 [[nodiscard]] static std::expected<SceneHandle, Core::CoriError<>> GetScene(const std::string_view name);
36
44 [[nodiscard]] static std::expected<SceneHandle, Core::CoriError<>> GetHandle(const uint32_t sceneID);
45
51 [[nodiscard]] static std::expected<void, Core::CoriError<>> DestroyScene(const std::string& name);
52
53 private:
54 friend Core::Application;
55 static void Init();
56 static void Shutdown();
57
58 struct Data;
59 static Data* s_Data;
60 };
61 }
62}
Main Application object, there can only be one Application object. Basically a root of the program.
Responsible for creating and managing scenes, has full lifetime control of the existing scenes.
static std::expected< SceneHandle, Core::CoriError<> > GetHandle(const uint32_t sceneID)
Allows you to get SceneHandle if all you know is scene id.
static std::expected< SceneHandle, Core::CoriError<> > GetScene(const std::string &name)
Retries the scene with the specified name from the cache.
static std::expected< void, Core::CoriError<> > DestroyScene(const std::string &name)
Destroys a scene with the specified name.
static std::expected< SceneHandle, Core::CoriError<> > CreateScene(const std::string &name)
Creates a scene with the specified name and adds it to the cache.
Core systems of the engine are here.
Anything connected to WorldSystem (ECS) is in this namespace.
Global engine namespace.