diff --git a/md_docs_md_locator.html b/md_docs_md_locator.html
index aada4f167..63e41b439 100644
--- a/md_docs_md_locator.html
+++ b/md_docs_md_locator.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/md_docs_md_meta.html b/md_docs_md_meta.html
index c1c050728..43d55984e 100644
--- a/md_docs_md_meta.html
+++ b/md_docs_md_meta.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/md_docs_md_process.html b/md_docs_md_process.html
index a60ac3cdd..cdb1112cb 100644
--- a/md_docs_md_process.html
+++ b/md_docs_md_process.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/md_docs_md_resource.html b/md_docs_md_resource.html
index b67b87758..36758269a 100644
--- a/md_docs_md_resource.html
+++ b/md_docs_md_resource.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/md_docs_md_signal.html b/md_docs_md_signal.html
index 7eb5386f8..b07e1a930 100644
--- a/md_docs_md_signal.html
+++ b/md_docs_md_signal.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/meta_8hpp_source.html b/meta_8hpp_source.html
index 0786ac6e9..edbc32b59 100644
--- a/meta_8hpp_source.html
+++ b/meta_8hpp_source.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/monostate_8hpp_source.html b/monostate_8hpp_source.html
index 69d32f33e..04d0582a8 100644
--- a/monostate_8hpp_source.html
+++ b/monostate_8hpp_source.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/namespaceentt.html b/namespaceentt.html
index 9ee08c74b..9dc79badf 100644
--- a/namespaceentt.html
+++ b/namespaceentt.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/namespacemembers.html b/namespacemembers.html
index 6013b3d1a..bacb6b02e 100644
--- a/namespacemembers.html
+++ b/namespacemembers.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/namespacemembers_func.html b/namespacemembers_func.html
index 170acae1d..37aafba64 100644
--- a/namespacemembers_func.html
+++ b/namespacemembers_func.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/namespacemembers_type.html b/namespacemembers_type.html
index 4abad7799..f32a961cc 100644
--- a/namespacemembers_type.html
+++ b/namespacemembers_type.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/namespacemembers_vars.html b/namespacemembers_vars.html
index 3f64b99e7..5147f8975 100644
--- a/namespacemembers_vars.html
+++ b/namespacemembers_vars.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/namespaces.html b/namespaces.html
index a59334c45..d962283f3 100644
--- a/namespaces.html
+++ b/namespaces.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/observer_8hpp_source.html b/observer_8hpp_source.html
index 84a43991c..ce87b0fe2 100644
--- a/observer_8hpp_source.html
+++ b/observer_8hpp_source.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
@@ -147,7 +147,7 @@ $(function() {
177 struct matcher_handler<matcher<type_list<Reject...>, type_list<Require...>, AnyOf>> {
178 template<std::
size_t Index>
179 static void maybe_valid_if(
basic_observer &obs,
const basic_registry<Entity> ®,
const Entity
entt) {
- 180 if(reg.template has<Require...>(
entt) && !(reg.template has<Reject>(
entt) || ...)) {
+ 180 if(reg.template has<Require...>(
entt) && !reg.template any<Reject...>(
entt)) {
181 if(
auto *comp = obs.view.try_get(
entt); !comp) {
182 obs.view.construct(
entt);
@@ -183,7 +183,7 @@ $(function() {
213 struct matcher_handler<matcher<type_list<Reject...>, type_list<Require...>, type_list<NoneOf...>, AllOf...>> {
214 template<std::
size_t Index>
215 static void maybe_valid_if(
basic_observer &obs,
const basic_registry<Entity> ®,
const Entity
entt) {
- 216 if(reg.template has<AllOf..., Require...>(
entt) && !(reg.template has<NoneOf>(
entt) || ...) && !(reg.template has<Reject>(
entt) || ...)) {
+ 216 if(reg.template has<AllOf..., Require...>(
entt) && !reg.template any<NoneOf..., Reject...>(
entt)) {
217 if(
auto *comp = obs.view.try_get(
entt); !comp) {
218 obs.view.construct(
entt);
diff --git a/pages.html b/pages.html
index b00200b36..9fcf3dde4 100644
--- a/pages.html
+++ b/pages.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/policy_8hpp_source.html b/policy_8hpp_source.html
index 95f043cef..080a093ae 100644
--- a/policy_8hpp_source.html
+++ b/policy_8hpp_source.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/process_8hpp_source.html b/process_8hpp_source.html
index bb9601c80..df9c0682b 100644
--- a/process_8hpp_source.html
+++ b/process_8hpp_source.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
diff --git a/registry_8hpp_source.html b/registry_8hpp_source.html
index 7208e8be4..dbea432ce 100644
--- a/registry_8hpp_source.html
+++ b/registry_8hpp_source.html
@@ -22,7 +22,7 @@
|
EnTT
- 3.3.1
+ 3.3.2
|
@@ -109,971 +109,965 @@ $(function() {
47 static_assert(std::is_same_v<Component, std::decay_t<Component>>);
- 50 using storage<Entity, Component>::storage;
-
-
- 53 return sink{construction};
-
-
-
-
-
-
-
- 61 return sink{destruction};
-
-
- 64 template<
typename... Args>
-
-
- 67 construction.publish(owner,
entt);
- 68 return this->
get(entt);
-
-
- 71 template<
typename It,
typename... Value>
- 72 std::enable_if_t<std::is_same_v<typename std::iterator_traits<It>::value_type, Entity>,
void>
-
- 74 this->
construct(first, last, std::forward<Value>(value)...);
-
- 76 if(!construction.empty()) {
- 77 std::for_each(first, last, [
this, &owner](
const auto entt) { construction.publish(owner,
entt); });
-
-
-
-
- 82 destruction.publish(owner,
entt);
-
-
-
-
-
- 88 if(std::distance(first, last) == std::distance(this->
begin(), this->
end())) {
- 89 if(!destruction.empty()) {
- 90 std::for_each(first, last, [
this, &owner](
const auto entt) { destruction.publish(owner,
entt); });
-
-
-
-
-
- 96 std::for_each(first, last, [
this, &owner](
const auto entt) { this->
remove(owner,
entt); });
-
-
-
- 100 template<
typename... Func>
-
- 102 (std::forward<Func>(func)(this->
get(entt)), ...);
- 103 update.publish(owner,
entt);
-
-
-
-
-
-
-
-
-
- 113 ENTT_ID_TYPE type_id{};
- 114 std::unique_ptr<sparse_set<Entity>> pool{};
-
-
-
-
-
- 120 template<
typename...>
- 121 struct group_handler;
-
- 123 template<
typename... Exclude,
typename... Get,
typename... Owned>
- 124 struct group_handler<exclude_t<Exclude...>, get_t<Get...>, Owned...> {
- 125 static_assert(std::conjunction_v<std::is_same<Owned, std::decay_t<Owned>>..., std::is_same<Get, std::decay_t<Get>>..., std::is_same<Exclude, std::decay_t<Exclude>>...>);
- 126 std::conditional_t<
sizeof...(Owned) == 0, sparse_set<Entity>, std::size_t>
current{};
-
- 128 template<
typename Component>
-
- 130 static_assert(std::disjunction_v<std::is_same<Owned, std::decay_t<Owned>>..., std::is_same<Get, std::decay_t<Get>>..., std::is_same<Exclude, std::decay_t<Exclude>>...>);
- 131 [[maybe_unused]]
const auto cpools = std::forward_as_tuple(owner.assure<Owned>()...);
-
- 133 const auto is_valid = ((std::is_same_v<Component, Owned> || std::get<pool_handler<Owned> &>(cpools).
has(
entt)) && ...)
- 134 && ((std::is_same_v<Component, Get> || owner.assure<Get>().
has(
entt)) && ...)
- 135 && ((std::is_same_v<Component, Exclude> || !owner.assure<Exclude>().
has(
entt)) && ...);
-
- 137 if constexpr(
sizeof...(Owned) == 0) {
-
-
-
-
- 142 if(is_valid && !(std::get<0>(cpools).index(
entt) <
current)) {
-
- 144 (std::get<pool_handler<Owned> &>(cpools).swap(std::get<pool_handler<Owned> &>(cpools).data()[pos],
entt), ...);
-
-
-
-
-
- 150 if constexpr(
sizeof...(Owned) == 0) {
-
-
-
-
- 155 if(
const auto cpools = std::forward_as_tuple(owner.assure<Owned>()...); std::get<0>(cpools).has(
entt) && (std::get<0>(cpools).index(
entt) <
current)) {
-
- 157 (std::get<pool_handler<Owned> &>(cpools).swap(std::get<pool_handler<Owned> &>(cpools).data()[pos],
entt), ...);
-
-
-
-
-
-
-
- 165 std::unique_ptr<void, void(*)(
void *)>
group;
- 166 bool (* owned)(
const ENTT_ID_TYPE) ENTT_NOEXCEPT;
- 167 bool (*
get)(
const ENTT_ID_TYPE) ENTT_NOEXCEPT;
- 168 bool (*
exclude)(
const ENTT_ID_TYPE) ENTT_NOEXCEPT;
-
-
- 171 struct basic_variable {
- 172 virtual ~basic_variable() =
default;
- 173 virtual ENTT_ID_TYPE type_id() const ENTT_NOEXCEPT = 0;
-
-
- 176 template<typename Type>
- 177 struct variable_handler: basic_variable {
- 178 static_assert(std::is_same_v<Type, std::decay_t<Type>>);
-
-
- 181 template<
typename... Args>
- 182 variable_handler(Args &&... args)
- 183 : value{std::forward<Args>(args)...}
-
-
- 186 ENTT_ID_TYPE type_id() const ENTT_NOEXCEPT
override {
-
-
-
-
- 191 template<
typename Component>
- 192 const pool_handler<Component> & assure()
const {
- 193 static std::size_t index{pools.size()};
-
-
-
-
- 198 if(index == pools.size()) {
- 199 auto &&pdata = pools.emplace_back();
-
-
- 202 pdata.pool.reset(
new pool_handler<Component>());
-
-
- 205 static_cast<pool_handler<Component> &
>(cpool).
remove(owner,
entt);
-
-
- 208 if constexpr(std::is_copy_constructible_v<std::decay_t<Component>>) {
- 209 pdata.assure = [](
basic_registry &other,
const sparse_set<entity_type> &cpool) {
- 210 if constexpr(ENTT_ENABLE_ETO(Component)) {
- 211 other.assure<Component>().
assign(other, cpool.begin(), cpool.end());
-
- 213 other.assure<Component>().
assign(other, cpool.begin(), cpool.end(),
static_cast<const pool_handler<Component> &
>(cpool).cbegin());
-
-
-
-
- 218 other.assign_or_replace<Component>(dst,
static_cast<const pool_handler<Component> &
>(cpool).
get(src));
-
-
-
-
-
- 224 return static_cast<pool_handler<Component> &
>(*pools[index].pool);
-
-
- 227 template<
typename Component>
- 228 pool_handler<Component> & assure() {
- 229 return const_cast<pool_handler<Component> &
>(std::as_const(*this).template assure<Component>());
-
-
-
-
-
-
-
-
-
-
-
-
-
- 253 template<
typename Component>
-
- 255 ENTT_ASSERT(std::none_of(pools.cbegin(), pools.cend(), [](
auto &&pdata) {
return pdata.type_id ==
type_info<Component>::id(); }));
-
-
-
- 264 template<
typename Component>
-
- 266 return assure<Component>().size();
-
-
-
- 274 return entities.size();
-
-
-
- 282 auto sz = entities.size();
- 283 auto curr = destroyed;
-
- 285 for(; curr !=
null; --sz) {
- 286 curr = entities[to_integral(curr) & traits_type::entity_mask];
-
-
-
-
-
- 305 template<
typename... Component>
-
- 307 if constexpr(
sizeof...(Component) == 0) {
- 308 entities.reserve(cap);
-
- 310 (assure<Component>().reserve(cap), ...);
-
-
-
- 319 template<
typename Component>
-
- 321 return assure<Component>().capacity();
-
-
-
- 330 return entities.capacity();
-
-
- 338 template<
typename... Component>
-
- 340 (assure<Component>().shrink_to_fit(), ...);
-
-
- 354 template<
typename... Component>
-
- 356 if constexpr(
sizeof...(Component) == 0) {
-
-
- 359 return (assure<Component>().
empty() && ...);
-
-
-
- 380 template<
typename Component>
- 381 const Component *
raw()
const {
- 382 return assure<Component>().raw();
-
-
- 386 template<
typename Component>
-
- 388 return const_cast<Component *>(std::as_const(*this).template raw<Component>());
-
-
- 404 template<
typename Component>
-
- 406 return assure<Component>().data();
-
-
-
- 422 return entities.data();
-
-
-
- 431 const auto pos =
size_type(to_integral(
entity) & traits_type::entity_mask);
- 432 return (pos < entities.size() && entities[pos] ==
entity);
-
-
-
-
-
-
-
-
-
-
-
- 467 const auto pos =
size_type(to_integral(
entity) & traits_type::entity_mask);
- 468 ENTT_ASSERT(pos < entities.size());
- 469 return version_type(to_integral(entities[pos]) >> traits_type::entity_shift);
-
-
-
-
-
- 485 if(destroyed ==
null) {
-
-
- 488 ENTT_ASSERT(to_integral(
entt) < traits_type::entity_mask);
-
- 490 const auto curr = to_integral(destroyed);
- 491 const auto version = to_integral(entities[curr]) & (traits_type::version_mask << traits_type::entity_shift);
- 492 destroyed =
entity_type{to_integral(entities[curr]) & traits_type::entity_mask};
-
-
-
-
-
-
-
- 511 ENTT_ASSERT(hint !=
null);
-
-
- 514 if(
const auto req = (to_integral(hint) & traits_type::entity_mask); !(req < entities.size())) {
- 515 entities.reserve(req + 1);
-
- 517 for(
auto pos = entities.size(); pos < req; ++pos) {
- 518 entities.emplace_back(destroyed);
-
-
-
- 522 entt = entities.emplace_back(hint);
- 523 }
else if(
const auto curr = (to_integral(entities[req]) & traits_type::entity_mask); req == curr) {
-
-
- 526 auto *it = &destroyed;
- 527 for(; (to_integral(*it) & traits_type::entity_mask) != req; it = &entities[to_integral(*it) & traits_type::entity_mask]);
- 528 *it =
entity_type{curr | (to_integral(*it) & (traits_type::version_mask << traits_type::entity_shift))};
- 529 entt = entities[req] = hint;
-
-
-
-
-
- 544 template<
typename It>
-
- 546 std::generate(first, last, [
this]() {
return create(); });
-
-
-
-
-
- 572 for(
auto pos = pools.size(); pos; --pos) {
- 573 if(
auto &pdata = pools[pos-1]; pdata.pool->has(
entity)) {
- 574 pdata.remove(*pdata.pool, *
this,
entity);
-
-
-
-
-
-
-
- 582 const auto entt = to_integral(
entity) & traits_type::entity_mask;
- 583 const auto version = ((to_integral(
entity) >> traits_type::entity_shift) + 1) << traits_type::entity_shift;
-
-
-
-
- 597 template<
typename It>
-
-
-
-
-
- 623 template<
typename Component,
typename... Args>
-
-
- 626 return assure<Component>().assign(*
this,
entity, std::forward<Args>(args)...);
-
-
- 640 template<
typename Component,
typename It>
- 641 std::enable_if_t<std::is_same_v<typename std::iterator_traits<It>::value_type,
entity_type>,
void>
- 642 assign(It first, It last,
const Component &value = {}) {
- 643 ENTT_ASSERT(std::all_of(first, last, [
this](
const auto entity) {
return valid(
entity); }));
- 644 assure<Component>().assign(*
this, first, last, value);
-
-
- 659 template<
typename Component,
typename EIt,
typename CIt>
- 660 std::enable_if_t<std::is_same_v<typename std::iterator_traits<EIt>::value_type,
entity_type>,
void>
-
- 662 ENTT_ASSERT(std::all_of(first, last, [
this](
const auto entity) {
return valid(
entity); }));
- 663 assure<Component>().assign(*
this, first, last, value);
-
-
- 677 template<
typename It>
-
- 679 ENTT_ASSERT(std::all_of(pools.cbegin(), pools.cend(), [](
auto &&cpool) {
return cpool.pool->empty(); }));
- 680 entities.assign(first, last);
-
-
- 683 for(std::size_t pos{}, end = entities.size(); pos < end; ++pos) {
- 684 if((to_integral(entities[pos]) & traits_type::entity_mask) != pos) {
- 685 const auto version = to_integral(entities[pos]) & (traits_type::version_mask << traits_type::entity_shift);
-
-
-
-
-
-
- 714 template<
typename Component,
typename... Args>
-
-
- 717 auto &cpool = assure<Component>();
-
-
- 720 ? (cpool.replace(*
this,
entity, [&args...](
auto &&component) { component = Component{std::forward<Args>(args)...}; }), cpool.get(
entity))
- 721 : cpool.assign(*
this,
entity, std::forward<Args>(args)...);
-
-
- 741 template<
typename Component,
typename... Func>
-
- 743 -> decltype(std::enable_if_t<
sizeof...(Func) != 0>(), (func(std::declval<Component &>()), ...),
void()) {
-
- 745 assure<Component>().replace(*
this,
entity, std::forward<Func>(func)...);
-
-
- 768 template<
typename Component,
typename... Args>
- 769 [[deprecated(
"use in-place replace instead")]]
-
- 771 -> decltype(Component{std::forward<Args>(args)...}, assure<Component>().get(
entity)) {
- 772 replace<Component>(
entity, [args = std::forward_as_tuple(std::forward<Args>(args)...)](
auto &&component) {
- 773 component = std::make_from_tuple<Component>(std::move(args));
-
-
- 776 return assure<Component>().get(
entity);
-
-
- 792 template<
typename... Component>
-
-
- 795 (assure<Component>().remove(*
this,
entity), ...);
-
-
- 808 template<
typename... Component,
typename It>
-
- 810 ENTT_ASSERT(std::all_of(first, last, [
this](
const auto entity) {
return valid(
entity); }));
- 811 (assure<Component>().remove(*
this, first, last), ...);
-
-
- 833 template<
typename... Component>
-
-
- 836 ([
this,
entity](
auto &&cpool) {
if(cpool.has(
entity)) { cpool.remove(*
this,
entity); } }(assure<Component>()), ...);
-
-
- 851 template<
typename... Component>
-
-
- 854 return (assure<Component>().
has(
entity) && ...);
-
-
- 870 template<
typename... Component>
-
-
- 873 return (assure<Component>().
has(
entity) || ...);
-
-
- 890 template<
typename... Component>
-
-
-
- 894 if constexpr(
sizeof...(Component) == 1) {
- 895 return (assure<Component>().
get(
entity), ...);
-
- 897 return std::forward_as_tuple(get<Component>(
entity)...);
-
-
-
- 902 template<
typename... Component>
-
-
-
- 906 if constexpr(
sizeof...(Component) == 1) {
- 907 return (assure<Component>().
get(
entity), ...);
-
- 909 return std::forward_as_tuple(get<Component>(
entity)...);
-
-
-
- 937 template<
typename Component,
typename... Args>
-
-
- 940 auto &cpool = assure<Component>();
- 941 return cpool.has(
entity) ? cpool.get(
entity) : cpool.assign(*
this,
entity, std::forward<Args>(args)...);
-
-
- 956 template<
typename... Component>
-
-
-
- 960 if constexpr(
sizeof...(Component) == 1) {
-
-
- 963 return std::make_tuple(try_get<Component>(
entity)...);
-
-
-
- 968 template<
typename... Component>
-
-
-
- 972 if constexpr(
sizeof...(Component) == 1) {
-
-
- 975 return std::make_tuple(try_get<Component>(
entity)...);
-
-
-
- 983 template<
typename... Component>
-
- 985 if constexpr(
sizeof...(Component) == 0) {
-
-
-
- 989 ([
this](
auto &&cpool) { cpool.remove(*
this, cpool.sparse_set<entity_type>::begin(), cpool.sparse_set<entity_type>::end()); }(assure<Component>()), ...);
-
-
-
- 1010 template<
typename Func>
-
- 1012 static_assert(std::is_invocable_v<Func, entity_type>);
-
- 1014 if(destroyed ==
null) {
- 1015 for(
auto pos = entities.size(); pos; --pos) {
- 1016 func(entities[pos-1]);
-
-
- 1019 for(
auto pos = entities.size(); pos; --pos) {
- 1020 if(
const auto entt = entities[pos - 1]; (to_integral(
entt) & traits_type::entity_mask) == (pos - 1)) {
-
-
-
-
-
-
-
-
- 1034 return std::none_of(pools.cbegin(), pools.cend(), [
entity](
auto &&pdata) {
return pdata.pool->has(
entity); });
-
-
- 1053 template<
typename Func>
-
- 1055 static_assert(std::is_invocable_v<Func, entity_type>);
-
-
-
-
-
-
-
-
- 1091 template<
typename Component>
-
- 1093 return assure<Component>().on_construct();
-
-
- 1121 template<
typename Component>
-
- 1123 return assure<Component>().on_replace();
-
-
- 1153 template<
typename Component>
-
- 1155 return assure<Component>().on_destroy();
-
-
- 1205 template<
typename Component,
typename Compare,
typename Sort =
std_sort,
typename... Args>
- 1206 void sort(Compare compare, Sort algo = Sort{}, Args &&... args) {
- 1207 auto &cpool = assure<Component>();
- 1208 ENTT_ASSERT(!cpool.super);
- 1209 cpool.sort(cpool.begin(), cpool.end(), std::move(compare), std::move(algo), std::forward<Args>(args)...);
-
-
- 1247 template<
typename To,
typename From>
-
- 1249 auto &cpool = assure<To>();
- 1250 ENTT_ASSERT(!cpool.super);
- 1251 cpool.respect(assure<From>());
-
-
- 1286 template<
typename... Component,
typename... Exclude>
-
- 1288 static_assert(
sizeof...(Component) > 0);
- 1289 return { assure<std::decay_t<Component>>()..., assure<Exclude>()... };
-
-
- 1293 template<
typename... Component,
typename... Exclude>
-
- 1295 static_assert(std::conjunction_v<std::is_const<Component>...>);
- 1296 return const_cast<basic_registry *>(
this)->view<Component...>(
exclude<Exclude...>);
-
-
- 1305 template<
typename... Component>
-
- 1307 return !(assure<Component>().super || ...);
-
-
- 1337 template<
typename... Owned,
typename... Get,
typename... Exclude>
-
- 1339 static_assert(
sizeof...(Owned) +
sizeof...(Get) > 0);
- 1340 static_assert(
sizeof...(Owned) +
sizeof...(Get) +
sizeof...(Exclude) > 1);
+
+ 51 return sink{construction};
+
+
+
+
+
+
+
+ 59 return sink{destruction};
+
+
+ 62 template<
typename... Args>
+
+
+ 65 construction.publish(owner,
entt);
+ 66 return this->
get(entt);
+
+
+ 69 template<
typename It,
typename... Value>
+ 70 std::enable_if_t<std::is_same_v<typename std::iterator_traits<It>::value_type, Entity>,
void>
+
+ 72 this->
construct(first, last, std::forward<Value>(value)...);
+
+ 74 if(!construction.empty()) {
+ 75 std::for_each(first, last, [
this, &owner](
const auto entt) { construction.publish(owner,
entt); });
+
+
+
+
+ 80 destruction.publish(owner,
entt);
+
+
+
+
+
+ 86 if(std::distance(first, last) == std::distance(this->
begin(), this->
end())) {
+ 87 if(!destruction.empty()) {
+ 88 std::for_each(first, last, [
this, &owner](
const auto entt) { destruction.publish(owner,
entt); });
+
+
+
+
+
+ 94 std::for_each(first, last, [
this, &owner](
const auto entt) { this->
remove(owner,
entt); });
+
+
+
+ 98 template<
typename... Func>
+
+ 100 (std::forward<Func>(func)(this->
get(entt)), ...);
+ 101 update.publish(owner,
entt);
+
+
+
+
+
+
+
+
+
+ 111 ENTT_ID_TYPE type_id{};
+ 112 std::unique_ptr<sparse_set<Entity>> pool{};
+
+
+
+
+
+ 118 template<
typename...>
+ 119 struct group_handler;
+
+ 121 template<
typename... Exclude,
typename... Get,
typename... Owned>
+ 122 struct group_handler<exclude_t<Exclude...>, get_t<Get...>, Owned...> {
+ 123 static_assert(std::conjunction_v<std::is_same<Owned, std::decay_t<Owned>>..., std::is_same<Get, std::decay_t<Get>>..., std::is_same<Exclude, std::decay_t<Exclude>>...>);
+ 124 std::conditional_t<
sizeof...(Owned) == 0, sparse_set<Entity>, std::size_t>
current{};
+
+ 126 template<
typename Component>
+
+ 128 static_assert(std::disjunction_v<std::is_same<Owned, std::decay_t<Owned>>..., std::is_same<Get, std::decay_t<Get>>..., std::is_same<Exclude, std::decay_t<Exclude>>...>);
+ 129 [[maybe_unused]]
const auto cpools = std::forward_as_tuple(owner.assure<Owned>()...);
+
+ 131 const auto is_valid = ((std::is_same_v<Component, Owned> || std::get<pool_handler<Owned> &>(cpools).
has(
entt)) && ...)
+ 132 && ((std::is_same_v<Component, Get> || owner.assure<Get>().
has(
entt)) && ...)
+ 133 && ((std::is_same_v<Component, Exclude> || !owner.assure<Exclude>().
has(
entt)) && ...);
+
+ 135 if constexpr(
sizeof...(Owned) == 0) {
+
+
+
+
+ 140 if(is_valid && !(std::get<0>(cpools).index(
entt) <
current)) {
+
+ 142 (std::get<pool_handler<Owned> &>(cpools).swap(std::get<pool_handler<Owned> &>(cpools).data()[pos],
entt), ...);
+
+
+
+
+
+ 148 if constexpr(
sizeof...(Owned) == 0) {
+
+
+
+
+ 153 if(
const auto cpools = std::forward_as_tuple(owner.assure<Owned>()...); std::get<0>(cpools).has(
entt) && (std::get<0>(cpools).index(
entt) <
current)) {
+
+ 155 (std::get<pool_handler<Owned> &>(cpools).swap(std::get<pool_handler<Owned> &>(cpools).data()[pos],
entt), ...);
+
+
+
+
+
+
+
+ 163 std::unique_ptr<void, void(*)(
void *)>
group;
+ 164 bool (* owned)(
const ENTT_ID_TYPE) ENTT_NOEXCEPT;
+ 165 bool (*
get)(
const ENTT_ID_TYPE) ENTT_NOEXCEPT;
+ 166 bool (*
exclude)(
const ENTT_ID_TYPE) ENTT_NOEXCEPT;
+
+
+ 169 struct basic_variable {
+ 170 virtual ~basic_variable() =
default;
+ 171 virtual ENTT_ID_TYPE type_id() const ENTT_NOEXCEPT = 0;
+
+
+ 174 template<typename Type>
+ 175 struct variable_handler: basic_variable {
+ 176 static_assert(std::is_same_v<Type, std::decay_t<Type>>);
+
+
+ 179 template<
typename... Args>
+ 180 variable_handler(Args &&... args)
+ 181 : value{std::forward<Args>(args)...}
+
+
+ 184 ENTT_ID_TYPE type_id() const ENTT_NOEXCEPT
override {
+
+
+
+
+ 189 template<
typename Component>
+ 190 const pool_handler<Component> & assure()
const {
+ 191 static std::size_t index{pools.size()};
+
+
+
+
+ 196 if(index == pools.size()) {
+ 197 auto &&pdata = pools.emplace_back();
+
+
+ 200 pdata.pool.reset(
new pool_handler<Component>());
+
+
+ 203 static_cast<pool_handler<Component> &
>(cpool).
remove(owner,
entt);
+
+
+ 206 if constexpr(std::is_copy_constructible_v<std::decay_t<Component>>) {
+ 207 pdata.assure = [](
basic_registry &other,
const sparse_set<entity_type> &cpool) {
+ 208 if constexpr(ENTT_ENABLE_ETO(Component)) {
+ 209 other.assure<Component>().
assign(other, cpool.begin(), cpool.end());
+
+ 211 other.assure<Component>().
assign(other, cpool.begin(), cpool.end(),
static_cast<const pool_handler<Component> &
>(cpool).cbegin());
+
+
+
+
+ 216 other.assign_or_replace<Component>(dst,
static_cast<const pool_handler<Component> &
>(cpool).
get(src));
+
+
+
+
+
+ 222 return static_cast<pool_handler<Component> &
>(*pools[index].pool);
+
+
+ 225 template<
typename Component>
+ 226 pool_handler<Component> & assure() {
+ 227 return const_cast<pool_handler<Component> &
>(std::as_const(*this).template assure<Component>());
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 251 template<
typename Component>
+
+ 253 ENTT_ASSERT(std::none_of(pools.cbegin(), pools.cend(), [](
auto &&pdata) {
return pdata.type_id ==
type_info<Component>::id(); }));
+
+
+
+ 262 template<
typename Component>
+
+ 264 return assure<Component>().size();
+
+
+
+ 272 return entities.size();
+
+
+
+ 280 auto sz = entities.size();
+ 281 auto curr = destroyed;
+
+ 283 for(; curr !=
null; --sz) {
+ 284 curr = entities[to_integral(curr) & traits_type::entity_mask];
+
+
+
+
+
+ 303 template<
typename... Component>
+
+ 305 if constexpr(
sizeof...(Component) == 0) {
+ 306 entities.reserve(cap);
+
+ 308 (assure<Component>().reserve(cap), ...);
+
+
+
+ 317 template<
typename Component>
+
+ 319 return assure<Component>().capacity();
+
+
+
+ 328 return entities.capacity();
+
+
+ 336 template<
typename... Component>
+
+ 338 (assure<Component>().shrink_to_fit(), ...);
+
+
+ 352 template<
typename... Component>
+
+ 354 if constexpr(
sizeof...(Component) == 0) {
+
+
+ 357 return (assure<Component>().
empty() && ...);
+
+
+
+ 378 template<
typename Component>
+ 379 const Component *
raw()
const {
+ 380 return assure<Component>().raw();
+
+
+ 384 template<
typename Component>
+
+ 386 return const_cast<Component *>(std::as_const(*this).template raw<Component>());
+
+
+ 402 template<
typename Component>
+
+ 404 return assure<Component>().data();
+
+
+
+ 420 return entities.data();
+
+
+
+ 429 const auto pos =
size_type(to_integral(
entity) & traits_type::entity_mask);
+ 430 return (pos < entities.size() && entities[pos] ==
entity);
+
+
+
+
+
+
+
+
+
+
+
+ 465 const auto pos =
size_type(to_integral(
entity) & traits_type::entity_mask);
+ 466 ENTT_ASSERT(pos < entities.size());
+ 467 return version_type(to_integral(entities[pos]) >> traits_type::entity_shift);
+
+
+
+
+
+ 483 if(destroyed ==
null) {
+
+
+ 486 ENTT_ASSERT(to_integral(
entt) < traits_type::entity_mask);
+
+ 488 const auto curr = to_integral(destroyed);
+ 489 const auto version = to_integral(entities[curr]) & (traits_type::version_mask << traits_type::entity_shift);
+ 490 destroyed =
entity_type{to_integral(entities[curr]) & traits_type::entity_mask};
+
+
+
+
+
+
+
+ 509 ENTT_ASSERT(hint !=
null);
+
+
+ 512 if(
const auto req = (to_integral(hint) & traits_type::entity_mask); !(req < entities.size())) {
+ 513 entities.reserve(req + 1);
+
+ 515 for(
auto pos = entities.size(); pos < req; ++pos) {
+ 516 entities.emplace_back(destroyed);
+
+
+
+ 520 entt = entities.emplace_back(hint);
+ 521 }
else if(
const auto curr = (to_integral(entities[req]) & traits_type::entity_mask); req == curr) {
+
+
+ 524 auto *it = &destroyed;
+ 525 for(; (to_integral(*it) & traits_type::entity_mask) != req; it = &entities[to_integral(*it) & traits_type::entity_mask]);
+ 526 *it =
entity_type{curr | (to_integral(*it) & (traits_type::version_mask << traits_type::entity_shift))};
+ 527 entt = entities[req] = hint;
+
+
+
+
+
+ 542 template<
typename It>
+
+ 544 std::generate(first, last, [
this]() {
return create(); });
+
+
+
+
+
+ 570 for(
auto pos = pools.size(); pos; --pos) {
+ 571 if(
auto &pdata = pools[pos-1]; pdata.pool->has(
entity)) {
+ 572 pdata.remove(*pdata.pool, *
this,
entity);
+
+
+
+
+
+
+
+ 580 const auto entt = to_integral(
entity) & traits_type::entity_mask;
+ 581 const auto version = ((to_integral(
entity) >> traits_type::entity_shift) + 1) << traits_type::entity_shift;
+
+
+
+
+ 595 template<
typename It>
+
+
+
+
+
+ 621 template<
typename Component,
typename... Args>
+
+
+ 624 return assure<Component>().assign(*
this,
entity, std::forward<Args>(args)...);
+
+
+ 638 template<
typename Component,
typename It>
+ 639 std::enable_if_t<std::is_same_v<typename std::iterator_traits<It>::value_type,
entity_type>,
void>
+ 640 assign(It first, It last,
const Component &value = {}) {
+ 641 ENTT_ASSERT(std::all_of(first, last, [
this](
const auto entity) {
return valid(
entity); }));
+ 642 assure<Component>().assign(*
this, first, last, value);
+
+
+ 657 template<
typename Component,
typename EIt,
typename CIt>
+ 658 std::enable_if_t<std::is_same_v<typename std::iterator_traits<EIt>::value_type,
entity_type>,
void>
+
+ 660 ENTT_ASSERT(std::all_of(first, last, [
this](
const auto entity) {
return valid(
entity); }));
+ 661 assure<Component>().assign(*
this, first, last, value);
+
+
+ 675 template<
typename It>
+
+ 677 ENTT_ASSERT(std::all_of(pools.cbegin(), pools.cend(), [](
auto &&cpool) {
return cpool.pool->empty(); }));
+ 678 entities.assign(first, last);
+
+
+ 681 for(std::size_t pos{}, end = entities.size(); pos < end; ++pos) {
+ 682 if((to_integral(entities[pos]) & traits_type::entity_mask) != pos) {
+ 683 const auto version = to_integral(entities[pos]) & (traits_type::version_mask << traits_type::entity_shift);
+
+
+
+
+
+
+ 712 template<
typename Component,
typename... Args>
+
+
+ 715 auto &cpool = assure<Component>();
+
+
+ 718 ? (cpool.replace(*
this,
entity, [&args...](
auto &&component) { component = Component{std::forward<Args>(args)...}; }), cpool.get(
entity))
+ 719 : cpool.assign(*
this,
entity, std::forward<Args>(args)...);
+
+
+ 739 template<
typename Component,
typename... Func>
+
+ 741 -> decltype(std::enable_if_t<
sizeof...(Func) != 0>(), (func(std::declval<Component &>()), ...),
void()) {
+
+ 743 assure<Component>().replace(*
this,
entity, std::forward<Func>(func)...);
+
+
+ 766 template<
typename Component,
typename... Args>
+ 767 [[deprecated(
"use in-place replace instead")]]
+
+ 769 -> decltype(Component{std::forward<Args>(args)...}, assure<Component>().get(
entity)) {
+ 770 replace<Component>(
entity, [args = std::forward_as_tuple(std::forward<Args>(args)...)](
auto &&component) {
+ 771 component = std::make_from_tuple<Component>(std::move(args));
+
+
+ 774 return assure<Component>().get(
entity);
+
+
+ 790 template<
typename... Component>
+
+
+ 793 (assure<Component>().remove(*
this,
entity), ...);
+
+
+ 806 template<
typename... Component,
typename It>
+
+ 808 ENTT_ASSERT(std::all_of(first, last, [
this](
const auto entity) {
return valid(
entity); }));
+ 809 (assure<Component>().remove(*
this, first, last), ...);
+
+
+ 831 template<
typename... Component>
+
+
+ 834 ([
this,
entity](
auto &&cpool) {
if(cpool.has(
entity)) { cpool.remove(*
this,
entity); } }(assure<Component>()), ...);
+
+
+ 849 template<
typename... Component>
+
+
+ 852 return (assure<Component>().
has(
entity) && ...);
+
+
+ 868 template<
typename... Component>
+
+
+ 871 return (assure<Component>().
has(
entity) || ...);
+
+
+ 888 template<
typename... Component>
+
+
+
+ 892 if constexpr(
sizeof...(Component) == 1) {
+ 893 return (assure<Component>().
get(
entity), ...);
+
+ 895 return std::forward_as_tuple(get<Component>(
entity)...);
+
+
+
+ 900 template<
typename... Component>
+
+
+
+ 904 if constexpr(
sizeof...(Component) == 1) {
+ 905 return (assure<Component>().
get(
entity), ...);
+
+ 907 return std::forward_as_tuple(get<Component>(
entity)...);
+
+
+
+ 935 template<
typename Component,
typename... Args>
+
+
+ 938 auto &cpool = assure<Component>();
+ 939 return cpool.has(
entity) ? cpool.get(
entity) : cpool.assign(*
this,
entity, std::forward<Args>(args)...);
+
+
+ 954 template<
typename... Component>
+
+
+
+ 958 if constexpr(
sizeof...(Component) == 1) {
+
+
+ 961 return std::make_tuple(try_get<Component>(
entity)...);
+
+
+
+ 966 template<
typename... Component>
+
+
+
+ 970 if constexpr(
sizeof...(Component) == 1) {
+
+
+ 973 return std::make_tuple(try_get<Component>(
entity)...);
+
+
+
+ 981 template<
typename... Component>
+
+ 983 if constexpr(
sizeof...(Component) == 0) {
+
+
+
+ 987 ([
this](
auto &&cpool) { cpool.remove(*
this, cpool.sparse_set<entity_type>::begin(), cpool.sparse_set<entity_type>::end()); }(assure<Component>()), ...);
+
+
+
+ 1008 template<
typename Func>
+
+ 1010 static_assert(std::is_invocable_v<Func, entity_type>);
+
+ 1012 if(destroyed ==
null) {
+ 1013 for(
auto pos = entities.size(); pos; --pos) {
+ 1014 func(entities[pos-1]);
+
+
+ 1017 for(
auto pos = entities.size(); pos; --pos) {
+ 1018 if(
const auto entt = entities[pos - 1]; (to_integral(
entt) & traits_type::entity_mask) == (pos - 1)) {
+
+
+
+
+
+
+
+
+ 1032 return std::none_of(pools.cbegin(), pools.cend(), [
entity](
auto &&pdata) {
return pdata.pool->has(
entity); });
+
+
+ 1051 template<
typename Func>
+
+ 1053 static_assert(std::is_invocable_v<Func, entity_type>);
+
+
+
+
+
+
+
+
+ 1089 template<
typename Component>
+
+ 1091 return assure<Component>().on_construct();
+
+
+ 1119 template<
typename Component>
+
+ 1121 return assure<Component>().on_replace();
+
+
+ 1151 template<
typename Component>
+
+ 1153 return assure<Component>().on_destroy();
+
+
+ 1203 template<
typename Component,
typename Compare,
typename Sort =
std_sort,
typename... Args>
+ 1204 void sort(Compare compare, Sort algo = Sort{}, Args &&... args) {
+ 1205 auto &cpool = assure<Component>();
+ 1206 ENTT_ASSERT(!cpool.super);
+ 1207 cpool.sort(cpool.begin(), cpool.end(), std::move(compare), std::move(algo), std::forward<Args>(args)...);
+
+
+ 1245 template<
typename To,
typename From>
+
+ 1247 auto &cpool = assure<To>();
+ 1248 ENTT_ASSERT(!cpool.super);
+ 1249 cpool.respect(assure<From>());
+
+
+ 1284 template<
typename... Component,
typename... Exclude>
+
+ 1286 static_assert(
sizeof...(Component) > 0);
+ 1287 return { assure<std::decay_t<Component>>()..., assure<Exclude>()... };
+
+
+ 1291 template<
typename... Component,
typename... Exclude>
+
+ 1293 static_assert(std::conjunction_v<std::is_const<Component>...>);
+ 1294 return const_cast<basic_registry *>(
this)->view<Component...>(
exclude<Exclude...>);
+
+
+ 1303 template<
typename... Component>
+
+ 1305 return !(assure<Component>().super || ...);
+
+
+ 1335 template<
typename... Owned,
typename... Get,
typename... Exclude>
+
+ 1337 static_assert(
sizeof...(Owned) +
sizeof...(Get) > 0);
+ 1338 static_assert(
sizeof...(Owned) +
sizeof...(Get) +
sizeof...(Exclude) > 1);
+
+
-
-
- 1344 const auto cpools = std::forward_as_tuple(assure<std::decay_t<Owned>>()..., assure<std::decay_t<Get>>()...);
- 1345 constexpr
auto size =
sizeof...(Owned) +
sizeof...(Get) +
sizeof...(Exclude);
- 1346 handler_type *handler =
nullptr;
-
- 1348 if(
auto it = std::find_if(groups.cbegin(), groups.cend(), [
size](
const auto &gdata) {
- 1349 return gdata.size ==
size
- 1350 && (gdata.owned(
type_info<std::decay_t<Owned>>::
id()) && ...)
- 1351 && (gdata.get(
type_info<std::decay_t<Get>>::
id()) && ...)
-
- 1353 }); it != groups.cend())
-
- 1355 handler = static_cast<handler_type *>(it->group.get());
-
-
-
- 1359 group_data candidate = {
-
- 1361 {
new handler_type{}, [](
void *instance) {
delete static_cast<handler_type *>(instance); } },
- 1362 []([[maybe_unused]]
const ENTT_ID_TYPE ctype) ENTT_NOEXCEPT {
return ((ctype == type_info<std::decay_t<Owned>>::
id()) || ...); },
- 1363 []([[maybe_unused]]
const ENTT_ID_TYPE ctype) ENTT_NOEXCEPT {
return ((ctype == type_info<std::decay_t<Get>>::
id()) || ...); },
- 1364 []([[maybe_unused]]
const ENTT_ID_TYPE ctype) ENTT_NOEXCEPT {
return ((ctype ==
type_info<Exclude>::id()) || ...); },
-
+ 1342 const auto cpools = std::forward_as_tuple(assure<std::decay_t<Owned>>()..., assure<std::decay_t<Get>>()...);
+ 1343 constexpr
auto size =
sizeof...(Owned) +
sizeof...(Get) +
sizeof...(Exclude);
+ 1344 handler_type *handler =
nullptr;
+
+ 1346 if(
auto it = std::find_if(groups.cbegin(), groups.cend(), [
size](
const auto &gdata) {
+ 1347 return gdata.size ==
size
+ 1348 && (gdata.owned(
type_info<std::decay_t<Owned>>::
id()) && ...)
+ 1349 && (gdata.get(
type_info<std::decay_t<Get>>::
id()) && ...)
+
+ 1351 }); it != groups.cend())
+
+ 1353 handler = static_cast<handler_type *>(it->group.get());
+
+
+
+ 1357 group_data candidate = {
+
+ 1359 {
new handler_type{}, [](
void *instance) {
delete static_cast<handler_type *>(instance); } },
+ 1360 []([[maybe_unused]]
const ENTT_ID_TYPE ctype) ENTT_NOEXCEPT {
return ((ctype == type_info<std::decay_t<Owned>>::
id()) || ...); },
+ 1361 []([[maybe_unused]]
const ENTT_ID_TYPE ctype) ENTT_NOEXCEPT {
return ((ctype == type_info<std::decay_t<Get>>::
id()) || ...); },
+ 1362 []([[maybe_unused]]
const ENTT_ID_TYPE ctype) ENTT_NOEXCEPT {
return ((ctype ==
type_info<Exclude>::id()) || ...); },
+
+
+ 1365 handler = static_cast<handler_type *>(candidate.group.get());
- 1367 handler = static_cast<handler_type *>(candidate.group.get());
-
- 1369 const void *maybe_valid_if =
nullptr;
- 1370 const void *discard_if =
nullptr;
-
- 1372 if constexpr(
sizeof...(Owned) == 0) {
- 1373 groups.push_back(std::move(candidate));
-
- 1375 ENTT_ASSERT(std::all_of(groups.cbegin(), groups.cend(), [
size](
const auto &gdata) {
- 1376 const auto overlapping = (0u + ... + gdata.owned(type_info<std::decay_t<Owned>>::
id()));
- 1377 const auto sz = overlapping + (0u + ... + gdata.get(type_info<std::decay_t<Get>>::
id())) + (0u + ... + gdata.exclude(
type_info<Exclude>::id()));
- 1378 return !overlapping || ((sz ==
size) || (sz == gdata.size));
-
-
- 1381 const auto next = std::find_if_not(groups.cbegin(), groups.cend(), [
size](
const auto &gdata) {
- 1382 return !(0u + ... + gdata.owned(type_info<std::decay_t<Owned>>::
id())) || (
size > (gdata.size));
-
-
- 1385 const auto prev = std::find_if(std::make_reverse_iterator(next), groups.crend(), [](
const auto &gdata) {
- 1386 return (0u + ... + gdata.owned(type_info<std::decay_t<Owned>>::
id()));
-
-
- 1389 maybe_valid_if = (next == groups.cend() ? maybe_valid_if : next->group.get());
- 1390 discard_if = (prev == groups.crend() ? discard_if : prev->group.get());
- 1391 groups.insert(next, std::move(candidate));
-
+ 1367 const void *maybe_valid_if =
nullptr;
+ 1368 const void *discard_if =
nullptr;
+
+ 1370 if constexpr(
sizeof...(Owned) == 0) {
+ 1371 groups.push_back(std::move(candidate));
+
+ 1373 ENTT_ASSERT(std::all_of(groups.cbegin(), groups.cend(), [
size](
const auto &gdata) {
+ 1374 const auto overlapping = (0u + ... + gdata.owned(type_info<std::decay_t<Owned>>::
id()));
+ 1375 const auto sz = overlapping + (0u + ... + gdata.get(type_info<std::decay_t<Get>>::
id())) + (0u + ... + gdata.exclude(
type_info<Exclude>::id()));
+ 1376 return !overlapping || ((sz ==
size) || (sz == gdata.size));
+
+
+ 1379 const auto next = std::find_if_not(groups.cbegin(), groups.cend(), [
size](
const auto &gdata) {
+ 1380 return !(0u + ... + gdata.owned(type_info<std::decay_t<Owned>>::
id())) || (
size > (gdata.size));
+
+
+ 1383 const auto prev = std::find_if(std::make_reverse_iterator(next), groups.crend(), [](
const auto &gdata) {
+ 1384 return (0u + ... + gdata.owned(type_info<std::decay_t<Owned>>::
id()));
+
+
+ 1387 maybe_valid_if = (next == groups.cend() ? maybe_valid_if : next->group.get());
+ 1388 discard_if = (prev == groups.crend() ? discard_if : prev->group.get());
+ 1389 groups.insert(next, std::move(candidate));
+
+
+ 1392 ((std::get<pool_handler<std::decay_t<Owned>> &>(cpools).super = std::max(std::get<pool_handler<std::decay_t<Owned>> &>(cpools).super,
size)), ...);
- 1394 ((std::get<pool_handler<std::decay_t<Owned>> &>(cpools).super = std::max(std::get<pool_handler<std::decay_t<Owned>> &>(cpools).super,
size)), ...);
-
- 1396 (on_construct<std::decay_t<Owned>>().before(maybe_valid_if).template connect<&handler_type::template maybe_valid_if<std::decay_t<Owned>>>(*handler), ...);
- 1397 (on_construct<std::decay_t<Get>>().before(maybe_valid_if).template connect<&handler_type::template maybe_valid_if<std::decay_t<Get>>>(*handler), ...);
- 1398 (on_destroy<Exclude>().before(maybe_valid_if).template connect<&handler_type::template maybe_valid_if<Exclude>>(*handler), ...);
-
- 1400 (on_destroy<std::decay_t<Owned>>().before(discard_if).template connect<&handler_type::discard_if>(*handler), ...);
- 1401 (on_destroy<std::decay_t<Get>>().before(discard_if).template connect<&handler_type::discard_if>(*handler), ...);
- 1402 (on_construct<Exclude>().before(discard_if).template connect<&handler_type::discard_if>(*handler), ...);
-
- 1404 if constexpr(
sizeof...(Owned) == 0) {
- 1405 for(
const auto entity: view<Owned..., Get...>(entt::exclude<Exclude...>)) {
- 1406 handler->current.construct(
entity);
-
-
- 1409 const auto curr =
view<Owned..., Get...>(
exclude<Exclude...>);
-
-
- 1412 std::for_each(std::make_reverse_iterator(curr.end()), std::make_reverse_iterator(curr.begin()), [cpools, handler](
const auto entity) {
- 1413 if(
const auto pos = handler->current; !(std::get<0>(cpools).index(
entity) < ++handler->current)) {
- 1414 (std::get<pool_handler<std::decay_t<Owned>> &>(cpools).swap(std::get<pool_handler<std::decay_t<Owned>> &>(cpools).data()[pos],
entity), ...);
-
-
-
+ 1394 (on_construct<std::decay_t<Owned>>().before(maybe_valid_if).template connect<&handler_type::template maybe_valid_if<std::decay_t<Owned>>>(*handler), ...);
+ 1395 (on_construct<std::decay_t<Get>>().before(maybe_valid_if).template connect<&handler_type::template maybe_valid_if<std::decay_t<Get>>>(*handler), ...);
+ 1396 (on_destroy<Exclude>().before(maybe_valid_if).template connect<&handler_type::template maybe_valid_if<Exclude>>(*handler), ...);
+
+ 1398 (on_destroy<std::decay_t<Owned>>().before(discard_if).template connect<&handler_type::discard_if>(*handler), ...);
+ 1399 (on_destroy<std::decay_t<Get>>().before(discard_if).template connect<&handler_type::discard_if>(*handler), ...);
+ 1400 (on_construct<Exclude>().before(discard_if).template connect<&handler_type::discard_if>(*handler), ...);
+
+ 1402 if constexpr(
sizeof...(Owned) == 0) {
+ 1403 for(
const auto entity: view<Owned..., Get...>(entt::exclude<Exclude...>)) {
+ 1404 handler->current.construct(
entity);
+
+
+
+ 1408 std::for_each(std::get<0>(cpools).
data(), std::get<0>(cpools).
data() + std::get<0>(cpools).
size(), [
this, handler](
const auto entity) {
+ 1409 handler->template maybe_valid_if<std::tuple_element_t<0, std::tuple<std::decay_t<Owned>...>>>(*
this,
entity);
+
+
+
+
+ 1414 if constexpr(
sizeof...(Owned) == 0) {
+ 1415 return { handler->current, std::get<pool_handler<std::decay_t<Get>> &>(cpools)... };
+
+ 1417 return { std::get<0>(cpools).super, handler->current, std::get<pool_handler<std::decay_t<Owned>> &>(cpools)... , std::get<pool_handler<std::decay_t<Get>> &>(cpools)... };
-
- 1420 if constexpr(
sizeof...(Owned) == 0) {
- 1421 return { handler->current, std::get<pool_handler<std::decay_t<Get>> &>(cpools)... };
-
- 1423 return { std::get<0>(cpools).super, handler->current, std::get<pool_handler<std::decay_t<Owned>> &>(cpools)... , std::get<pool_handler<std::decay_t<Get>> &>(cpools)... };
-
-
-
- 1437 template<
typename... Owned,
typename... Get,
typename... Exclude>
-
- 1439 static_assert(std::conjunction_v<std::is_const<Owned>..., std::is_const<Get>...>);
- 1440 return const_cast<basic_registry *>(
this)->group<Owned...>(
entt::get<Get...>,
exclude<Exclude...>);
-
-
- 1452 template<
typename... Owned,
typename... Exclude>
-
- 1454 return group<Owned...>(entt::get<>,
exclude<Exclude...>);
-
-
- 1466 template<
typename... Owned,
typename... Exclude>
-
- 1468 static_assert(std::conjunction_v<std::is_const<Owned>...>);
- 1469 return const_cast<basic_registry *>(
this)->group<Owned...>(
exclude<Exclude...>);
-
-
- 1492 template<
typename It>
-
- 1494 std::vector<const sparse_set<Entity> *> selected(std::distance(first, last));
-
- 1496 std::transform(first, last, selected.begin(), [
this](
const auto ctype) {
- 1497 const auto it = std::find_if(pools.cbegin(), pools.cend(), [ctype](
auto &&pdata) {
return pdata.type_id == ctype; });
- 1498 return it == pools.cend() ? nullptr : it->pool.get();
-
-
- 1501 return { std::move(selected) };
-
-
- 1537 template<
typename... Component,
typename... Exclude>
- 1538 [[deprecated(
"use ::visit and custom (eventually erased) functions instead")]]
-
-
-
- 1542 other.destroyed = destroyed;
- 1543 other.entities = entities;
-
- 1545 std::for_each(pools.cbegin(), pools.cend(), [&other](
auto &&pdata) {
- 1546 if constexpr(
sizeof...(Component) == 0) {
-
- 1548 pdata.assure(other, *pdata.pool);
-
-
- 1551 static_assert(
sizeof...(Exclude) == 0 && std::conjunction_v<std::is_copy_constructible<Component>...>);
-
- 1553 pdata.assure(other, *pdata.pool);
-
-
-
-
-
-
-
- 1583 template<
typename... Exclude>
- 1584 [[deprecated(
"use ::visit and custom (eventually erased) functions instead")]]
-
- 1586 std::for_each(other.pools.cbegin(), other.pools.cend(), [
this, dst, src](
auto &&pdata) {
-
- 1588 ENTT_ASSERT(pdata.stamp);
- 1589 pdata.stamp(*
this, dst, *pdata.pool, src);
-
-
-
-
-
-
-
- 1607 const auto head = to_integral(destroyed);
- 1608 const entity_type seed = (destroyed ==
null) ? destroyed :
entity_type{head | (to_integral(entities[head]) & (traits_type::version_mask << traits_type::entity_shift))};
-
-
- 1611 const auto &others = reg.entities;
- 1612 const auto entt = to_integral(
entity) & traits_type::entity_mask;
- 1613 const auto curr = to_integral(others[
entt]) & traits_type::entity_mask;
- 1614 return entity_type{curr | (to_integral(others[curr]) & (traits_type::version_mask << traits_type::entity_shift))};
-
-
- 1617 return {
this, seed, follow };
-
-
-
-
-
-
- 1639 const auto entt = to_integral(
entity) & traits_type::entity_mask;
- 1640 auto &others = reg.entities;
+
+
+ 1431 template<
typename... Owned,
typename... Get,
typename... Exclude>
+
+ 1433 static_assert(std::conjunction_v<std::is_const<Owned>..., std::is_const<Get>...>);
+ 1434 return const_cast<basic_registry *>(
this)->group<Owned...>(
entt::get<Get...>,
exclude<Exclude...>);
+
+
+ 1446 template<
typename... Owned,
typename... Exclude>
+
+ 1448 return group<Owned...>(entt::get<>,
exclude<Exclude...>);
+
+
+ 1460 template<
typename... Owned,
typename... Exclude>
+
+ 1462 static_assert(std::conjunction_v<std::is_const<Owned>...>);
+ 1463 return const_cast<basic_registry *>(
this)->group<Owned...>(
exclude<Exclude...>);
+
+
+ 1486 template<
typename It>
+
+ 1488 std::vector<const sparse_set<Entity> *> selected(std::distance(first, last));
+
+ 1490 std::transform(first, last, selected.begin(), [
this](
const auto ctype) {
+ 1491 const auto it = std::find_if(pools.cbegin(), pools.cend(), [ctype](
auto &&pdata) {
return pdata.type_id == ctype; });
+ 1492 return it == pools.cend() ? nullptr : it->pool.get();
+
+
+ 1495 return { std::move(selected) };
+
+
+ 1531 template<
typename... Component,
typename... Exclude>
+ 1532 [[deprecated(
"use ::visit and custom (eventually erased) functions instead")]]
+
+
+
+ 1536 other.destroyed = destroyed;
+ 1537 other.entities = entities;
+
+ 1539 std::for_each(pools.cbegin(), pools.cend(), [&other](
auto &&pdata) {
+ 1540 if constexpr(
sizeof...(Component) == 0) {
+
+ 1542 pdata.assure(other, *pdata.pool);
+
+
+ 1545 static_assert(
sizeof...(Exclude) == 0 && std::conjunction_v<std::is_copy_constructible<Component>...>);
+
+ 1547 pdata.assure(other, *pdata.pool);
+
+
+
+
+
+
+
+ 1577 template<
typename... Exclude>
+ 1578 [[deprecated(
"use ::visit and custom (eventually erased) functions instead")]]
+
+ 1580 std::for_each(other.pools.cbegin(), other.pools.cend(), [
this, dst, src](
auto &&pdata) {
+
+ 1582 ENTT_ASSERT(pdata.stamp);
+ 1583 pdata.stamp(*
this, dst, *pdata.pool, src);
+
+
+
+
+
+
+
+ 1601 const auto head = to_integral(destroyed);
+ 1602 const entity_type seed = (destroyed ==
null) ? destroyed :
entity_type{head | (to_integral(entities[head]) & (traits_type::version_mask << traits_type::entity_shift))};
+
+
+ 1605 const auto &others = reg.entities;
+ 1606 const auto entt = to_integral(
entity) & traits_type::entity_mask;
+ 1607 const auto curr = to_integral(others[
entt]) & traits_type::entity_mask;
+ 1608 return entity_type{curr | (to_integral(others[curr]) & (traits_type::version_mask << traits_type::entity_shift))};
+
+
+ 1611 return {
this, seed, follow };
+
+
+
+
+
+
+ 1633 const auto entt = to_integral(
entity) & traits_type::entity_mask;
+ 1634 auto &others = reg.entities;
+
+ 1636 if(!(
entt < others.size())) {
+ 1637 auto curr = others.size();
+ 1638 others.resize(
entt + 1);
+ 1639 std::generate(others.data() + curr, others.data() +
entt, [&curr]() {
return entity_type(curr++); });
+
- 1642 if(!(
entt < others.size())) {
- 1643 auto curr = others.size();
- 1644 others.resize(
entt + 1);
- 1645 std::generate(others.data() + curr, others.data() +
entt, [&curr]() {
return entity_type(curr++); });
-
-
-
-
-
-
- 1652 const auto version = to_integral(
entity) & (traits_type::version_mask << traits_type::entity_shift);
-
-
-
-
-
-
-
-
- 1661 return {
this, force };
-
-
- 1685 template<
typename Func>
-
- 1687 for(
auto pos = pools.size(); pos; --pos) {
- 1688 if(
auto &pdata = pools[pos-1]; pdata.pool->has(
entity)) {
- 1689 func(pdata.type_id);
-
-
-
-
- 1714 template<
typename Func>
-
- 1716 for(
auto pos = pools.size(); pos; --pos) {
- 1717 func(pools[pos-1].type_id);
-
-
-
- 1732 template<
typename Type,
typename... Args>
-
-
- 1735 vars.emplace_back(
new variable_handler<Type>{std::forward<Args>(args)...});
- 1736 return static_cast<variable_handler<Type> &
>(*vars.back()).value;
-
-
- 1743 template<
typename Type>
-
- 1745 vars.erase(std::remove_if(vars.begin(), vars.end(), [](
auto &&handler) {
-
-
-
-
- 1761 template<
typename Type,
typename... Args>
-
- 1763 auto *value = try_ctx<Type>();
- 1764 return value ? *value : set<Type>(std::forward<Args>(args)...);
-
-
- 1773 template<
typename Type>
-
- 1775 auto it = std::find_if(vars.cbegin(), vars.cend(), [](
auto &&handler) {
return handler->type_id() ==
type_info<Type>::id(); });
- 1776 return it == vars.cend() ? nullptr : &
static_cast<const variable_handler<Type> &
>(*it->get()).value;
+
+
+
+
+ 1646 const auto version = to_integral(
entity) & (traits_type::version_mask << traits_type::entity_shift);
+
+
+
+
+
+
+
+
+ 1655 return {
this, force };
+
+
+ 1679 template<
typename Func>
+
+ 1681 for(
auto pos = pools.size(); pos; --pos) {
+ 1682 if(
auto &pdata = pools[pos-1]; pdata.pool->has(
entity)) {
+ 1683 func(pdata.type_id);
+
+
+
+
+ 1708 template<
typename Func>
+
+ 1710 for(
auto pos = pools.size(); pos; --pos) {
+ 1711 func(pools[pos-1].type_id);
+
+
+
+ 1726 template<
typename Type,
typename... Args>
+
+
+ 1729 vars.emplace_back(
new variable_handler<Type>{std::forward<Args>(args)...});
+ 1730 return static_cast<variable_handler<Type> &
>(*vars.back()).value;
+
+
+ 1737 template<
typename Type>
+
+ 1739 vars.erase(std::remove_if(vars.begin(), vars.end(), [](
auto &&handler) {
+
+
+
+
+ 1755 template<
typename Type,
typename... Args>
+
+ 1757 auto *value = try_ctx<Type>();
+ 1758 return value ? *value : set<Type>(std::forward<Args>(args)...);
+
+
+ 1767 template<
typename Type>
+
+ 1769 auto it = std::find_if(vars.cbegin(), vars.cend(), [](
auto &&handler) {
return handler->type_id() ==
type_info<Type>::id(); });
+ 1770 return it == vars.cend() ? nullptr : &
static_cast<const variable_handler<Type> &
>(*it->get()).value;
+
+
+ 1774 template<
typename Type>
+
+ 1776 return const_cast<Type *>(std::as_const(*this).template try_ctx<Type>());
- 1780 template<
typename Type>
-
- 1782 return const_cast<Type *>(std::as_const(*this).template try_ctx<Type>());
-
-
- 1797 template<
typename Type>
-
- 1799 const auto *instance = try_ctx<Type>();
- 1800 ENTT_ASSERT(instance);
-
+ 1791 template<
typename Type>
+
+ 1793 const auto *instance = try_ctx<Type>();
+ 1794 ENTT_ASSERT(instance);
+
+
+
+ 1799 template<
typename Type>
+
+ 1801 return const_cast<Type &>(std::as_const(*this).template ctx<Type>());
- 1805 template<
typename Type>
-
- 1807 return const_cast<Type &>(std::as_const(*this).template ctx<Type>());
-
-
- 1830 template<
typename Func>
-
- 1832 for(
auto pos = vars.size(); pos; --pos) {
- 1833 func(vars[pos-1]->type_id());
-
-
-
-
- 1838 std::vector<group_data> groups{};
- 1839 mutable std::vector<pool_data> pools{};
- 1840 std::vector<std::unique_ptr<basic_variable>> vars{};
- 1841 std::vector<entity_type> entities{};
-
-
-
-
-
-
-
-
+ 1824 template<
typename Func>
+
+ 1826 for(
auto pos = vars.size(); pos; --pos) {
+ 1827 func(vars[pos-1]->type_id());
+
+
+
+
+ 1832 std::vector<group_data> groups{};
+ 1833 mutable std::vector<pool_data> pools{};
+ 1834 std::vector<std::unique_ptr<basic_variable>> vars{};
+ 1835 std::vector<entity_type> entities{};
+
+
+
+
+
+
+
+
-Component * raw()
Direct access to the list of components of a given pool.
-void clear()
Clears a whole registry or the pools for the given components.
-entity_type create()
Creates a new entity and returns it.
-Type & ctx_or_set(Args &&... args)
Binds an object to the context of the registry.
-Type & set(Args &&... args)
Binds an object to the context of the registry.
-entt::basic_snapshot< Entity > snapshot() const
Returns a temporary object to use to create snapshots.
+Component * raw()
Direct access to the list of components of a given pool.
+void clear()
Clears a whole registry or the pools for the given components.
+entity_type create()
Creates a new entity and returns it.
+Type & ctx_or_set(Args &&... args)
Binds an object to the context of the registry.
+Type & set(Args &&... args)
Binds an object to the context of the registry.
+entt::basic_snapshot< Entity > snapshot() const
Returns a temporary object to use to create snapshots.
basic_registry & operator=(basic_registry &&)=default
Default move assignment operator.
-const entity_type * data() const
Direct access to the list of entities of a given pool.
-void sort()
Sorts two pools of components in the same way.
+const entity_type * data() const
Direct access to the list of entities of a given pool.
+void sort()
Sorts two pools of components in the same way.
constexpr exclude_t< Type... > exclude
Variable template for exclusion lists.
Utility class to create snapshots from a registry.
-size_type alive() const
Returns the number of entities still in use.
-entity_type create(const entity_type hint)
Creates a new entity and returns it.
-auto on_replace()
Returns a sink object for the given component.
-void shrink_to_fit()
Requests the removal of unused capacity for the given components.
-void prepare()
Prepares a pool for the given type if required.
-const Type & ctx() const
Returns a reference to an object in the context of the registry.
-bool sortable() const
Checks whether the given components belong to any group.
-void stamp(const entity_type dst, const basic_registry &other, const entity_type src, exclude_t< Exclude... >={})
Stamps an entity onto another entity.
+size_type alive() const
Returns the number of entities still in use.
+entity_type create(const entity_type hint)
Creates a new entity and returns it.
+auto on_replace()
Returns a sink object for the given component.
+void shrink_to_fit()
Requests the removal of unused capacity for the given components.
+void prepare()
Prepares a pool for the given type if required.
+const Type & ctx() const
Returns a reference to an object in the context of the registry.
+bool sortable() const
Checks whether the given components belong to any group.
+void stamp(const entity_type dst, const basic_registry &other, const entity_type src, exclude_t< Exclude... >={})
Stamps an entity onto another entity.
constexpr get_t< Type... > get
Variable template for lists of observed components.
-entt::basic_view< Entity, exclude_t< Exclude... >, Component... > view(exclude_t< Exclude... >={}) const
Returns a view for the given components.
-decltype(auto) assign(const entity_type entity, Args &&... args)
Assigns the given component to an entity.
-void visit(Func func) const
Visits a registry and returns the types for its components.
-std::enable_if_t< std::is_same_v< typename std::iterator_traits< EIt >::value_type, entity_type >, void > assign(EIt first, EIt last, CIt value)
Assigns each entity in a range the given components.
+entt::basic_view< Entity, exclude_t< Exclude... >, Component... > view(exclude_t< Exclude... >={}) const
Returns a view for the given components.
+decltype(auto) assign(const entity_type entity, Args &&... args)
Assigns the given component to an entity.
+void visit(Func func) const
Visits a registry and returns the types for its components.
+std::enable_if_t< std::is_same_v< typename std::iterator_traits< EIt >::value_type, entity_type >, void > assign(EIt first, EIt last, CIt value)
Assigns each entity in a range the given components.
Alias for exclusion lists.
-void remove(It first, It last)
Removes the given components from all the entities in a range.
-entt::basic_group< Entity, exclude_t< Exclude... >, get_t< Get... >, Owned... > group(get_t< Get... >, exclude_t< Exclude... >={}) const
Returns a group for the given components.
-void remove_if_exists(const entity_type entity)
Removes the given components from an entity.
+void remove(It first, It last)
Removes the given components from all the entities in a range.
+entt::basic_group< Entity, exclude_t< Exclude... >, get_t< Get... >, Owned... > group(get_t< Get... >, exclude_t< Exclude... >={}) const
Returns a group for the given components.
+void remove_if_exists(const entity_type entity)
Removes the given components from an entity.
auto replace(const entity_type entity, Func &&... func) -> decltype(std::enable_if_t< sizeof...(Func) !=0 >()
Replaces the given component for an entity.
-void destroy(const entity_type entity)
Destroys an entity and lets the registry recycle the identifier.
-size_type size() const
Returns the number of existing components of the given type.
-decltype(auto) assign_or_replace(const entity_type entity, Args &&... args)
Assigns or replaces the given component for an entity.
+void destroy(const entity_type entity)
Destroys an entity and lets the registry recycle the identifier.
+size_type size() const
Returns the number of existing components of the given type.
+decltype(auto) assign_or_replace(const entity_type entity, Args &&... args)
Assigns or replaces the given component for an entity.
-entt::basic_group< Entity, exclude_t< Exclude... >, get_t<>, Owned... > group(exclude_t< Exclude... >={}) const
Returns a group for the given components.
-static entity_type entity(const entity_type entity) ENTT_NOEXCEPT
Returns the entity identifier without the version.
-bool empty() const
Checks whether the registry or the pools of the given components are empty.
-auto on_construct()
Returns a sink object for the given component.
-void create(It first, It last)
Assigns each element in a range an entity.
-void each(Func func) const
Iterates all the entities that are still in use.
-bool orphan(const entity_type entity) const
Checks if an entity has components assigned.
-void orphans(Func func) const
Iterates orphans and applies them the given function object.
-void visit(entity_type entity, Func func) const
Visits an entity and returns the types for its components.
-size_type capacity() const ENTT_NOEXCEPT
Returns the number of entities that a registry has currently allocated space for.
-const Type * try_ctx() const
Returns a pointer to an object in the context of the registry.
+entt::basic_group< Entity, exclude_t< Exclude... >, get_t<>, Owned... > group(exclude_t< Exclude... >={}) const
Returns a group for the given components.
+static entity_type entity(const entity_type entity) ENTT_NOEXCEPT
Returns the entity identifier without the version.
+bool empty() const
Checks whether the registry or the pools of the given components are empty.
+auto on_construct()
Returns a sink object for the given component.
+void create(It first, It last)
Assigns each element in a range an entity.
+void each(Func func) const
Iterates all the entities that are still in use.
+bool orphan(const entity_type entity) const
Checks if an entity has components assigned.
+void orphans(Func func) const
Iterates orphans and applies them the given function object.
+void visit(entity_type entity, Func func) const
Visits an entity and returns the types for its components.
+size_type capacity() const ENTT_NOEXCEPT
Returns the number of entities that a registry has currently allocated space for.
+const Type * try_ctx() const
Returns a pointer to an object in the context of the registry.
basic_registry()=default
Default constructor.
-basic_snapshot_loader< Entity > loader()
Returns a temporary object to use to load snapshots.
+basic_snapshot_loader< Entity > loader()
Returns a temporary object to use to load snapshots.
-decltype(auto) get_or_assign(const entity_type entity, Args &&... args)
Returns a reference to the given component for an entity.
-std::enable_if_t< std::is_same_v< typename std::iterator_traits< It >::value_type, entity_type >, void > assign(It first, It last, const Component &value={})
Assigns each entity in a range the given component.
+decltype(auto) get_or_assign(const entity_type entity, Args &&... args)
Returns a reference to the given component for an entity.
+std::enable_if_t< std::is_same_v< typename std::iterator_traits< It >::value_type, entity_type >, void > assign(It first, It last, const Component &value={})
Assigns each entity in a range the given component.
-void assign(It first, It last)
Assigns entities to an empty registry.
+void assign(It first, It last)
Assigns entities to an empty registry.
sink(sigh< Ret(Args...)> &) ENTT_NOEXCEPT -> sink< Ret(Args...)>
Deduction guide.
-auto on_destroy()
Returns a sink object for the given component.
+auto on_destroy()
Returns a sink object for the given component.
void construct(const entity_type entt, Args &&... args)
Assigns an entity to a storage and constructs its object.
Alias for lists of observed components.
-bool any(const entity_type entity) const
Checks if an entity has at least one of the given components.
-version_type current(const entity_type entity) const
Returns the actual version for an entity identifier.
-size_type size() const ENTT_NOEXCEPT
Returns the number of entities created so far.
-size_type capacity() const
Returns the capacity of the pool for the given component.
-void reserve(const size_type cap)
Increases the capacity of the registry or of the pools for the given components.
+bool any(const entity_type entity) const
Checks if an entity has at least one of the given components.
+version_type current(const entity_type entity) const
Returns the actual version for an entity identifier.
+size_type size() const ENTT_NOEXCEPT
Returns the number of entities created so far.
+size_type capacity() const
Returns the capacity of the pool for the given component.
+void reserve(const size_type cap)
Increases the capacity of the registry or of the pools for the given components.
static ENTT_ID_TYPE id() ENTT_NOEXCEPT
Returns the numeric representation of a given type.
-entt::basic_group< Entity, exclude_t< Exclude... >, get_t<>, Owned... > group(exclude_t< Exclude... >={})
Returns a group for the given components.
+entt::basic_group< Entity, exclude_t< Exclude... >, get_t<>, Owned... > group(exclude_t< Exclude... >={})
Returns a group for the given components.
const_iterator_type end() const ENTT_NOEXCEPT
Returns an iterator to the end.
Fast and reliable entity-component system.
-entt::basic_runtime_view< Entity > runtime_view(It first, It last) const
Returns a runtime view for the given components.
-decltype(auto) get([[maybe_unused]] const entity_type entity) const
Returns references to the given components for an entity.
-auto try_get([[maybe_unused]] const entity_type entity)
Returns pointers to the given components for an entity.
-bool has(const entity_type entity) const
Checks if an entity has all the given components.
-auto replace(const entity_type entity, Args &&... args) -> decltype(Component
Replaces the given component for an entity.
-static version_type version(const entity_type entity) ENTT_NOEXCEPT
Returns the version stored along with an entity identifier.
-void destroy(It first, It last)
Destroys all the entities in a range.
-entt::basic_view< Entity, exclude_t< Exclude... >, Component... > view(exclude_t< Exclude... >={})
Returns a view for the given components.
-entt::basic_group< Entity, exclude_t< Exclude... >, get_t< Get... >, Owned... > group(get_t< Get... >, exclude_t< Exclude... >={})
Returns a group for the given components.
-void ctx(Func func) const
Visits a registry and returns the types for its context variables.
-bool valid(const entity_type entity) const
Checks if an entity identifier refers to a valid entity.
+entt::basic_runtime_view< Entity > runtime_view(It first, It last) const
Returns a runtime view for the given components.
+decltype(auto) get([[maybe_unused]] const entity_type entity) const
Returns references to the given components for an entity.
+auto try_get([[maybe_unused]] const entity_type entity)
Returns pointers to the given components for an entity.
+bool has(const entity_type entity) const
Checks if an entity has all the given components.
+auto replace(const entity_type entity, Args &&... args) -> decltype(Component
Replaces the given component for an entity.
+static version_type version(const entity_type entity) ENTT_NOEXCEPT
Returns the version stored along with an entity identifier.
+void destroy(It first, It last)
Destroys all the entities in a range.
+entt::basic_view< Entity, exclude_t< Exclude... >, Component... > view(exclude_t< Exclude... >={})
Returns a view for the given components.
+entt::basic_group< Entity, exclude_t< Exclude... >, get_t< Get... >, Owned... > group(get_t< Get... >, exclude_t< Exclude... >={})
Returns a group for the given components.
+void ctx(Func func) const
Visits a registry and returns the types for its context variables.
+bool valid(const entity_type entity) const
Checks if an entity identifier refers to a valid entity.
-auto try_get([[maybe_unused]] const entity_type entity) const
Returns pointers to the given components for an entity.
-Type & ctx()
Returns a reference to an object in the context of the registry.
-std::size_t size_type
Unsigned integer type.
-void sort(Compare compare, Sort algo=Sort{}, Args &&... args)
Sorts the pool of entities for the given component.
-const entity_type * data() const ENTT_NOEXCEPT
Direct access to the list of entities of a registry.
+auto try_get([[maybe_unused]] const entity_type entity) const
Returns pointers to the given components for an entity.
+Type & ctx()
Returns a reference to an object in the context of the registry.
+std::size_t size_type
Unsigned integer type.
+void sort(Compare compare, Sort algo=Sort{}, Args &&... args)
Sorts the pool of entities for the given component.
+const entity_type * data() const ENTT_NOEXCEPT
Direct access to the list of entities of a registry.
const_iterator_type begin() const ENTT_NOEXCEPT
Returns an iterator to the beginning.
-const Component * raw() const
Direct access to the list of components of a given pool.
-void unset()
Unsets a context variable if it exists.
-basic_registry clone(exclude_t< Exclude... >={}) const
Returns a full or partial copy of a registry.
-Entity entity_type
Underlying entity identifier.
+const Component * raw() const
Direct access to the list of components of a given pool.
+void unset()
Unsets a context variable if it exists.
+basic_registry clone(exclude_t< Exclude... >={}) const
Returns a full or partial copy of a registry.
+Entity entity_type
Underlying entity identifier.
Function object to wrap std::sort in a class type.
-void remove(const entity_type entity)
Removes the given components from an entity.
-Type * try_ctx()
Returns a pointer to an object in the context of the registry.
+void remove(const entity_type entity)
Removes the given components from an entity.
+Type * try_ctx()
Returns a pointer to an object in the context of the registry.
Utility class to restore a snapshot as a whole.
-typename traits_type::version_type version_type
Underlying version type.
+typename traits_type::version_type version_type
Underlying version type.