Class SceneManager

Inheritance Relationships

Base Type

Class Documentation

class legion::core::scenemanagement::SceneManager : public legion::core::System<SceneManager>

Public Types

using additional_loader_fn = delegate<void(ecs::entity_handle)>

Public Functions

SceneManager() = default
inline virtual void setup()

Initialization of the SceneManager.

Note

During the setup we attempt to find all .cornflake files and preload them.

Public Static Functions

static ecs::entity_handle create_scene_entity(const std::string &name = "Scene")

Creates a scene entity, to store all objects.

static ecs::component_handle<scene> create_scene(const std::string &name = "Scene")

Creates a scene with given name.

Return

bool Signifying whether it was successful.

Parameters
  • name: The name you wish to set the scene.

static ecs::component_handle<scene> create_scene(const std::string &name, ecs::entity_handle &ent)

Creates a scene with given name.

Return

bool Signifying whether it was successful.

Parameters
  • name: The name you wish to set the scene to.

  • ent: A specific entity to create a scene from.

static ecs::component_handle<scene> load_scene(const std::string &name)

Deserializes the scene from the disk.

Return

bool Signifying whether it was successful.

Parameters
  • name: The name of the file to deserialize.

static ecs::component_handle<scene> save_scene(const std::string &name, ecs::entity_handle &ent)

Serializes a scene to disk.

Return

bool Signifying whether it was successful.

Parameters
  • name: string of the name of the scene you wish to save.

  • ent: a specific entity to serialize.

static ecs::component_handle<scene> get_scene(std::string name)

Gets a scene from the scene list.

Return

component_handle<scene> The component handle for the scene component stored in the sceneList.

Parameters
  • name: The name of the scene that you wish to save.

static ecs::entity_handle get_scene_entity(std::string name)

Gets a scene.

Return

entiyt_handle The entity handle of the scene.

Parameters
  • name: string of the scenes name that you wish to get.

template<class component_type>
static inline void add_loader(additional_loader_fn additional_loader)

Public Static Attributes

static int sceneCount
static ecs::component_handle<scene> currentScene
static std::unordered_map<id_type, std::string> sceneNames
static std::unordered_map<id_type, ecs::component_handle<scene>> sceneList

Friends

friend class legion::core::Engine