From efb2bbe8b2b25a898efc86ba6e09cd57426d126f Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 21 Jan 2020 12:33:37 +0100 Subject: [PATCH] cleanup: removed entity/utility.hpp --- TODO | 1 - src/entt/entity/group.hpp | 2 +- src/entt/entity/helper.hpp | 35 ++++++++++++++++++++++++++- src/entt/entity/registry.hpp | 2 +- src/entt/entity/utility.hpp | 46 ------------------------------------ src/entt/entity/view.hpp | 2 +- src/entt/entt.hpp | 1 - 7 files changed, 37 insertions(+), 52 deletions(-) delete mode 100644 src/entt/entity/utility.hpp diff --git a/TODO b/TODO index 41e29dc21..3038e1d00 100644 --- a/TODO +++ b/TODO @@ -19,7 +19,6 @@ * any-of rule for views/groups (eg entity has A and any of B/C/D) - get -> all, exclude -> none * deprecate sigh::publish, use operator() -* merge entity/helper and entt/utility * WIP: snapshot rework/deprecation - remove snapshot/loader from registry, make them external (faster) tools diff --git a/src/entt/entity/group.hpp b/src/entt/entity/group.hpp index 2bda3e1f8..ac47502cf 100644 --- a/src/entt/entity/group.hpp +++ b/src/entt/entity/group.hpp @@ -9,7 +9,7 @@ #include "../core/type_traits.hpp" #include "sparse_set.hpp" #include "storage.hpp" -#include "utility.hpp" +#include "helper.hpp" #include "fwd.hpp" diff --git a/src/entt/entity/helper.hpp b/src/entt/entity/helper.hpp index f9b02a45f..3c4bbc667 100644 --- a/src/entt/entity/helper.hpp +++ b/src/entt/entity/helper.hpp @@ -3,13 +3,46 @@ #include +#include "../core/type_traits.hpp" #include "../config/config.h" -#include "registry.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 Converts a registry to a view. * @tparam Const Constness of the accepted registry. diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index d55ea57ea..1b3eb910b 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -19,7 +19,7 @@ #include "sparse_set.hpp" #include "snapshot.hpp" #include "storage.hpp" -#include "utility.hpp" +#include "helper.hpp" #include "entity.hpp" #include "group.hpp" #include "view.hpp" diff --git a/src/entt/entity/utility.hpp b/src/entt/entity/utility.hpp deleted file mode 100644 index 683d6540c..000000000 --- a/src/entt/entity/utility.hpp +++ /dev/null @@ -1,46 +0,0 @@ -#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 diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index 720e8f5ee..cf6c66af3 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -12,7 +12,7 @@ #include "../core/type_traits.hpp" #include "sparse_set.hpp" #include "storage.hpp" -#include "utility.hpp" +#include "helper.hpp" #include "entity.hpp" #include "fwd.hpp" diff --git a/src/entt/entt.hpp b/src/entt/entt.hpp index 3065a3093..b17aa1ff0 100644 --- a/src/entt/entt.hpp +++ b/src/entt/entt.hpp @@ -17,7 +17,6 @@ #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"