|
Unravel Engine C++ Reference
|
Component that holds a reference to a prefab asset and tracks property overrides. More...
#include <prefab_component.h>
Public Member Functions | |
| void | clear_overrides () |
| Clear all overrides (for applying all changes to prefab) | |
| void | add_override (const hpp::uuid &entity_uuid, const std::string &component_path) |
| Add a property override. | |
| void | add_override (const hpp::uuid &entity_uuid, const std::string &component_path, const std::string &pretty_component_path) |
| Add a property override with pretty path. | |
| auto | has_override (const hpp::uuid &entity_uuid, const std::string &component_path) const -> bool |
| Check if a property is overridden. | |
| void | remove_override (const hpp::uuid &entity_uuid, const std::string &component_path) |
| Remove a property override. | |
| void | remove_entity (const hpp::uuid &entity_uuid) |
| Remove an entity from the prefab. | |
| auto | get_all_overrides () const -> const std::set< prefab_property_ override _data > & |
| Get all overrides. | |
| auto | has_serialization_override (const std::string &serialization_path) const -> bool |
| Check if a serialization path has an override (for backward compatibility) | |
Public Member Functions inherited from unravel::owned_component | |
| auto | operator= (const owned_component &other) -> owned_component &=default |
| void | set_owner (entt::handle owner) |
| Sets the owner of the component. | |
| auto | get_owner () const noexcept -> entt::const_handle |
| Gets the owner of the component. | |
| auto | get_owner () noexcept -> entt::handle |
| Gets the owner of the component. | |
Public Member Functions inherited from unravel::basic_component | |
| void | touch () |
| Marks the component as 'touched'. | |
Public Attributes | |
| asset_handle< prefab > | source |
| Handle to the prefab asset. | |
| std::set< prefab_property_override_data > | property_overrides |
| Storage of property overrides Each override is identified by entity UUID + component path This allows entity renaming without invalidating overrides. | |
| std::set< hpp::uuid > | removed_entities |
| bool | changed = false |
Public Attributes inherited from unravel::basic_component | |
| bool | eto {} |
| Disable empty type optimizations. | |
Static Public Attributes | |
| static constexpr bool | in_place_delete = false |
Static Public Attributes inherited from unravel::component_crtp< prefab_component, owned_component > | |
| static constexpr bool | in_place_delete |
| Indicates if the component can be deleted in place. | |
Additional Inherited Members | |
Public Types inherited from unravel::component_crtp< prefab_component, owned_component > | |
| using | base |
Static Public Member Functions inherited from unravel::owned_component | |
| template<typename T > | |
| static void | on_create_component (entt::registry &r, entt::entity e) |
| template<typename T > | |
| static void | on_destroy_component (entt::registry &r, entt::entity e) |
Component that holds a reference to a prefab asset and tracks property overrides.
Definition at line 36 of file prefab_component.h.
| void unravel::prefab_component::add_override | ( | const hpp::uuid & | entity_uuid, |
| const std::string & | component_path ) |
Add a property override.
| entity_uuid | The UUID of the entity being overridden |
| component_path | The component type + property path |
Definition at line 42 of file prefab_component.cpp.
| void unravel::prefab_component::add_override | ( | const hpp::uuid & | entity_uuid, |
| const std::string & | component_path, | ||
| const std::string & | pretty_component_path ) |
Add a property override with pretty path.
| entity_uuid | The UUID of the entity being overridden |
| component_path | The component type + property path |
| pretty_component_path | The human-readable component path |
Definition at line 47 of file prefab_component.cpp.
| void unravel::prefab_component::clear_overrides | ( | ) |
Clear all overrides (for applying all changes to prefab)
Definition at line 36 of file prefab_component.cpp.
|
override |
Get all overrides.
Definition at line 120 of file prefab_component.cpp.
| auto unravel::prefab_component::has_override | ( | const hpp::uuid & | entity_uuid, |
| const std::string & | component_path ) const -> bool |
Check if a property is overridden.
| entity_uuid | The UUID of the entity |
| component_path | The component type + property path |
Definition at line 95 of file prefab_component.cpp.
| auto unravel::prefab_component::has_serialization_override | ( | const std::string & | serialization_path | ) | const -> bool |
Check if a serialization path has an override (for backward compatibility)
| serialization_path | The path in format "entities/uuid/components/component/path" |
Definition at line 125 of file prefab_component.cpp.
| void unravel::prefab_component::remove_entity | ( | const hpp::uuid & | entity_uuid | ) |
Remove an entity from the prefab.
| entity_uuid | The UUID of the entity |
Definition at line 105 of file prefab_component.cpp.
| void unravel::prefab_component::remove_override | ( | const hpp::uuid & | entity_uuid, |
| const std::string & | component_path ) |
Remove a property override.
| entity_uuid | The UUID of the entity |
| component_path | The component type + property path |
Definition at line 100 of file prefab_component.cpp.
| bool unravel::prefab_component::changed = false |
Definition at line 54 of file prefab_component.h.
|
staticconstexpr |
Definition at line 38 of file prefab_component.h.
| std::set<prefab_property_override_data> unravel::prefab_component::property_overrides |
Storage of property overrides Each override is identified by entity UUID + component path This allows entity renaming without invalidating overrides.
Definition at line 50 of file prefab_component.h.
| std::set<hpp::uuid> unravel::prefab_component::removed_entities |
Definition at line 52 of file prefab_component.h.
| asset_handle<prefab> unravel::prefab_component::source |
Handle to the prefab asset.
Definition at line 43 of file prefab_component.h.