diff --git a/src/entt/entity/group.hpp b/src/entt/entity/group.hpp index 13daadd96..d00a555c6 100644 --- a/src/entt/entity/group.hpp +++ b/src/entt/entity/group.hpp @@ -9,44 +9,13 @@ #include "../core/type_traits.hpp" #include "sparse_set.hpp" #include "storage.hpp" +#include "utility.hpp" #include "fwd.hpp" namespace entt { -/** - * @brief Alias for exclusion lists. - * @tparam Type List of types. - */ -template -struct exclude_t: type_list {}; - - -/** - * @brief Variable template for exclusion lists. - * @tparam Type List of types. - */ -template -constexpr exclude_t exclude{}; - - -/** - * @brief Alias for lists of observed components. - * @tparam Type List of types. - */ -template -struct get_t: type_list {}; - - -/** - * @brief Variable template for lists of observed components. - * @tparam Type List of types. - */ -template -constexpr get_t get{}; - - /** * @brief Group. * diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index e32129492..aa4004bde 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -20,6 +20,7 @@ #include "sparse_set.hpp" #include "snapshot.hpp" #include "storage.hpp" +#include "utility.hpp" #include "entity.hpp" #include "group.hpp" #include "view.hpp" @@ -141,7 +142,7 @@ class basic_registry { struct group_handler; template - struct group_handler, type_list>: sparse_set { + struct group_handler, get_t>: sparse_set { std::tuple *..., pool_type *...> cpools{}; template @@ -168,7 +169,7 @@ class basic_registry { }; template - struct group_handler, type_list, Owned...>: group_type { + struct group_handler, get_t, Owned...>: group_type { std::tuple *..., pool_type *..., pool_type *...> cpools{}; template @@ -1312,7 +1313,7 @@ public: static_assert(sizeof...(Owned) + sizeof...(Get) > 0); static_assert(sizeof...(Owned) + sizeof...(Get) + sizeof...(Exclude) > 1); - using handler_type = group_handler, type_list, Owned...>; + using handler_type = group_handler, get_t, Owned...>; const std::size_t extent[] = { sizeof...(Owned), sizeof...(Get), sizeof...(Exclude) }; const ENTT_ID_TYPE types[] = { type()..., type()..., type()... }; diff --git a/src/entt/entity/utility.hpp b/src/entt/entity/utility.hpp new file mode 100644 index 000000000..9faeeb0d7 --- /dev/null +++ b/src/entt/entity/utility.hpp @@ -0,0 +1,46 @@ +#ifndef ENTT_ENTITY_UTILITY_HPP +#define ENTT_ENTITY_UTILITY_HPP + + +#include "../core/type_traits.hpp" + + +namespace entt { + + +/** + * @brief Alias for exclusion lists. + * @tparam Type List of types. + */ +template +struct exclude_t: type_list {}; + + +/** + * @brief Variable template for exclusion lists. + * @tparam Type List of types. + */ +template +constexpr exclude_t exclude{}; + + +/** + * @brief Alias for lists of observed components. + * @tparam Type List of types. + */ +template +struct get_t: type_list{}; + + +/** + * @brief Variable template for lists of observed components. + * @tparam Type List of types. + */ +template +constexpr get_t get{}; + + +} + + +#endif // ENTT_ENTITY_UTILITY_HPP diff --git a/src/entt/entt.hpp b/src/entt/entt.hpp index 0ceb826e6..8f343df10 100644 --- a/src/entt/entt.hpp +++ b/src/entt/entt.hpp @@ -16,6 +16,7 @@ #include "entity/snapshot.hpp" #include "entity/sparse_set.hpp" #include "entity/storage.hpp" +#include "entity/utility.hpp" #include "entity/view.hpp" #include "locator/locator.hpp" #include "meta/factory.hpp"