R-Type 0.1
Loading...
Searching...
No Matches
rtk::Scene Concept Reference

Requirements for a scene managed by rtk::SceneManager. More...

#include <sceneManager/sceneConcept.hpp>

Concept definition

template<typename T, typename TSceneId, typename TInput>
concept rtk::Scene =
requires(T &scene, EngineContext &context, const TInput &input, float dt) {
{ T::Type } -> std::convertible_to<TSceneId>;
{ scene.onEnter(context) } -> std::same_as<void>;
{
scene.onUpdate(context, input, dt)
} -> std::same_as<std::optional<TSceneId>>;
{ scene.onExit(context) } -> std::same_as<void>;
}
Requirements for a type used to identify scenes, which must be an enum.
Definition sceneConcept.hpp:21
Requirements for a scene managed by rtk::SceneManager.
Definition sceneConcept.hpp:39

Detailed Description

Requirements for a scene managed by rtk::SceneManager.

A valid scene has a static Type identifier and the onEnter(), onUpdate() and onExit() methods. onUpdate() returns the identifier of the next scene, or std::nullopt to stay on the current one.

Template Parameters
TConcrete scene type being validated.
TSceneIdType used to identify scenes, usually an enum.
TInputType containing the input state passed to the scene.