12 : entity_uuid(uuid), component_path(path), pretty_component_path(path)
17 : entity_uuid(uuid), component_path(path), pretty_component_path(pretty_path)
23 return entity_uuid == other.entity_uuid && component_path == other.component_path;
28 if (entity_uuid != other.entity_uuid)
30 return entity_uuid < other.entity_uuid;
32 return component_path < other.component_path;
50 auto is_parent_path = [](
const std::string& parent,
const std::string& child) ->
bool
52 if (child.length() <= parent.length())
56 if (child.substr(0, parent.length()) != parent)
60 char next_char = child[parent.length()];
61 return next_char ==
'/' || next_char ==
'[';
65 std::vector<prefab_property_override_data> to_remove;
69 if (existing_override.entity_uuid != entity_uuid)
75 if (is_parent_path(existing_override.component_path, component_path))
77 to_remove.push_back(existing_override);
80 else if (is_parent_path(component_path, existing_override.component_path))
88 for (
const auto& override_to_remove : to_remove)
90 remove_override(override_to_remove.entity_uuid, override_to_remove.component_path);
111 if(
override.entity_uuid == entity_uuid)
137 auto uuid_opt = hpp::uuid::from_string(uuid_str);
138 if (!uuid_opt.has_value())
144 std::string component_path;
145 bool first_segment =
true;
147 for (
size_t i = 3; i <
segments.size(); ++i)
151 component_path +=
"/";
154 first_segment =
false;
157 if(has_override(uuid_opt.value(), component_path))
159 APPLOG_TRACE(
"Serialization override found for property: {}", serialization_path);
#define APPLOG_TRACE(...)
auto tokenize(const std::string &str, const std::string &delimiters) -> string_tokens_t
const segment_list * segments
void remove_override(const hpp::uuid &entity_uuid, const std::string &component_path)
Remove a property override.
void clear_overrides()
Clear all overrides (for applying all changes to prefab)
auto has_serialization_override(const std::string &serialization_path) const -> bool
Check if a serialization path has an override (for backward compatibility)
auto has_override(const hpp::uuid &entity_uuid, const std::string &component_path) const -> bool
Check if a property is overridden.
std::set< hpp::uuid > removed_entities
std::set< prefab_property_override_data > property_overrides
Storage of property overrides Each override is identified by entity UUID + component path This allows...
void remove_entity(const hpp::uuid &entity_uuid)
Remove an entity from the prefab.
void add_override(const hpp::uuid &entity_uuid, const std::string &component_path)
Add a property override.
auto get_all_overrides() const -> const std::set< prefab_property_ override _data > &
Get all overrides.
Represents a property override with entity UUID and component/property path.
prefab_property_override_data()=default
auto operator==(const prefab_property_override_data &other) const -> bool
auto operator<(const prefab_property_override_data &other) const -> bool