|
|
@@ -237,7 +237,7 @@ class basic_registry {
|
|
|
void maybe_valid_if(basic_registry &owner, const Entity entt) {
|
|
|
[[maybe_unused]] const auto cpools = std::forward_as_tuple(owner.assure<Owned>()...);
|
|
|
|
|
|
- const auto is_valid = ((std::is_same_v<Component, Owned> || std::get<storage_for_t<Owned, entity_type> &>(cpools).contains(entt)) && ...)
|
|
|
+ const auto is_valid = ((std::is_same_v<Component, Owned> || std::get<storage_for_type<Owned> &>(cpools).contains(entt)) && ...)
|
|
|
&& ((std::is_same_v<Component, Get> || owner.assure<Get>().contains(entt)) && ...)
|
|
|
&& ((std::is_same_v<Component, Exclude> || !owner.assure<Exclude>().contains(entt)) && ...);
|
|
|
|
|
|
@@ -248,7 +248,7 @@ class basic_registry {
|
|
|
} else {
|
|
|
if(is_valid && !(std::get<0>(cpools).index(entt) < current)) {
|
|
|
const auto pos = current++;
|
|
|
- (std::get<storage_for_t<Owned, entity_type> &>(cpools).swap_elements(std::get<storage_for_t<Owned, entity_type> &>(cpools).data()[pos], entt), ...);
|
|
|
+ (std::get<storage_for_type<Owned> &>(cpools).swap_elements(std::get<storage_for_type<Owned> &>(cpools).data()[pos], entt), ...);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -259,7 +259,7 @@ class basic_registry {
|
|
|
} else {
|
|
|
if(const auto cpools = std::forward_as_tuple(owner.assure<Owned>()...); std::get<0>(cpools).contains(entt) && (std::get<0>(cpools).index(entt) < current)) {
|
|
|
const auto pos = --current;
|
|
|
- (std::get<storage_for_t<Owned, entity_type> &>(cpools).swap_elements(std::get<storage_for_t<Owned, entity_type> &>(cpools).data()[pos], entt), ...);
|
|
|
+ (std::get<storage_for_type<Owned> &>(cpools).swap_elements(std::get<storage_for_type<Owned> &>(cpools).data()[pos], entt), ...);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -279,12 +279,12 @@ class basic_registry {
|
|
|
auto &&cpool = pools[id];
|
|
|
|
|
|
if(!cpool) {
|
|
|
- cpool.reset(new storage_type_t<Component, entity_type>{});
|
|
|
+ cpool.reset(new storage_for_type<Component>{});
|
|
|
cpool->bind(forward_as_any(*this));
|
|
|
}
|
|
|
|
|
|
ENTT_ASSERT(cpool->type() == type_id<Component>(), "Unexpected type");
|
|
|
- return static_cast<storage_type_t<Component, entity_type> &>(*cpool);
|
|
|
+ return static_cast<storage_for_type<Component> &>(*cpool);
|
|
|
}
|
|
|
|
|
|
template<typename Component>
|
|
|
@@ -293,10 +293,10 @@ class basic_registry {
|
|
|
|
|
|
if(const auto it = pools.find(id); it != pools.cend()) {
|
|
|
ENTT_ASSERT(it->second->type() == type_id<Component>(), "Unexpected type");
|
|
|
- return static_cast<const storage_type_t<Component, entity_type> &>(*it->second);
|
|
|
+ return static_cast<const storage_for_type<Component> &>(*it->second);
|
|
|
}
|
|
|
|
|
|
- static storage_type_t<Component, entity_type> placeholder{};
|
|
|
+ static storage_for_type<Component> placeholder{};
|
|
|
return placeholder;
|
|
|
}
|
|
|
|
|
|
@@ -1331,7 +1331,7 @@ public:
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return {handler->current, std::get<storage_for_t<std::remove_const_t<Owned>, entity_type> &>(cpools)..., std::get<storage_for_t<std::remove_const_t<Get>, entity_type> &>(cpools)...};
|
|
|
+ return {handler->current, std::get<storage_for_type<std::remove_const_t<Owned>> &>(cpools)..., std::get<storage_for_type<std::remove_const_t<Get>> &>(cpools)...};
|
|
|
}
|
|
|
|
|
|
/*! @copydoc group */
|