2#include <engine/engine_export.h>
8#include <entt/entt.hpp>
10using namespace entt::literals;
15#define ENTT_TAG(name) entt::tag<name##_hs>
25 scene(
const std::string& tag_name);
67 auto create_handle(entt::entity e)
const -> entt::const_handle;
75 auto create_entity(
const std::string&
tag = {}, entt::handle parent = {}) -> entt::handle;
83 auto clone_entity(entt::handle clone_from,
bool keep_parent =
true) -> entt::handle;
84 void clone_entity(entt::handle& clone_to, entt::handle clone_from,
bool keep_parent =
true);
93 static auto create_entity(entt::registry& r,
const std::string&
name = {}, entt::handle parent = {}) -> entt::handle;
123#define TAG_COMPONENT(name) entt::tag<name##_hs>
Represents a handle to an asset, providing access and management functions.
Represents a scene in the ACE framework, managing entities and their relationships.
void clear_entity(entt::handle &handle)
asset_handle< scene_prefab > source
The source prefab asset handle for the scene.
auto load_from(const asset_handle< scene_prefab > &pfb) -> bool
Loads a scene from a prefab asset.
auto instantiate_out(const asset_handle< prefab > &pfb, entt::handle &e) -> bool
Instantiates a prefab in the scene.
static void clone_scene(const scene &src_scene, scene &dst_scene)
Clones the entities from one scene to another.
auto instantiate(const asset_handle< prefab > &pfb) -> entt::handle
~scene()
Destroys the scene and cleans up resources.
static auto get_all_scenes() -> const std::vector< scene * > &
auto create_entity(const std::string &tag={}, entt::handle parent={}) -> entt::handle
Creates an entity in the scene with an optional tag and parent.
auto clone_entity(entt::handle clone_from, bool keep_parent=true) -> entt::handle
Clones an existing entity in the scene.
void unload()
Unloads the scene, removing all entities.
std::unique_ptr< entt::registry > registry
The registry that manages all entities in the scene.
scene(const std::string &tag_name)
Constructs a new scene.
auto create_handle(entt::entity e) -> entt::handle
Creates an entity in the scene.
static auto find_entity_by_prefab_uuid(entt::handle root_entity, const hpp::uuid &target_uuid) -> entt::handle
Finds an entity by UUID in the scene.