NcEngine
NcScene.h
Go to the documentation of this file.
1
5#pragma once
6
10#include "ncengine/type/EngineId.h"
11
12#include <functional>
13
14namespace nc
15{
29class NcScene : public Module
30{
31 public:
32 explicit NcScene() noexcept
33 : Module{NcSceneId} {}
34
35 virtual ~NcScene() = default;
36
41 virtual auto Queue(std::unique_ptr<Scene> scene) noexcept -> size_t = 0;
42
44 virtual void DequeueScene(size_t queuePosition) = 0;
45
47 virtual auto GetNumberOfScenesInQueue() const noexcept -> size_t = 0;
48
50 virtual void ScheduleTransition() noexcept = 0;
51
53 virtual auto IsTransitionScheduled() const noexcept -> bool = 0;
54
60 virtual auto UnloadActiveScene() -> bool = 0;
61
68 virtual auto LoadQueuedScene(ecs::Ecs world, ModuleRegistry& modules) -> bool = 0;
69};
70
72auto BuildSceneModule() -> std::unique_ptr<NcScene>;
73} // namespace nc
Modules are extensions that provide functionality to the engine.
Definition: Module.h:18
Definition: ModuleRegistry.h:19
Module managing the scene queue and transitions.
Definition: NcScene.h:30
virtual auto UnloadActiveScene() -> bool=0
Unload the active scene and destroy it.
virtual void ScheduleTransition() noexcept=0
Schedule a transition to the next queued scene upon completion of the current frame.
virtual void DequeueScene(size_t queuePosition)=0
Remove a scene from the scene queue.
virtual auto Queue(std::unique_ptr< Scene > scene) noexcept -> size_t=0
Add a scene to the scene queue.
virtual auto LoadQueuedScene(ecs::Ecs world, ModuleRegistry &modules) -> bool=0
Load the next scene from the scene queue.
virtual auto GetNumberOfScenesInQueue() const noexcept -> size_t=0
Get the number of scenes in the scene queue.
virtual auto IsTransitionScheduled() const noexcept -> bool=0
Check if a scene transition is currently scheduled.