|
|
@@ -25,7 +25,6 @@
|
|
|
#include "runtime_view.hpp"
|
|
|
#include "sparse_set.hpp"
|
|
|
#include "storage.hpp"
|
|
|
-#include "utility.hpp"
|
|
|
#include "view.hpp"
|
|
|
|
|
|
namespace entt {
|
|
|
@@ -1261,7 +1260,7 @@ public:
|
|
|
* @return A newly created group.
|
|
|
*/
|
|
|
template<typename... Owned, typename... Get, typename... Exclude>
|
|
|
- [[nodiscard]] basic_group<entity_type, owned_t<Owned...>, get_t<Get...>, exclude_t<Exclude...>> group(get_t<Get...>, exclude_t<Exclude...> = {}) {
|
|
|
+ [[nodiscard]] basic_group<entity_type, owned_t<Owned...>, get_t<Get...>, exclude_t<Exclude...>> group(get_t<Get...> = {}, exclude_t<Exclude...> = {}) {
|
|
|
static_assert(sizeof...(Owned) + sizeof...(Get) > 0, "Exclusion-only groups are not supported");
|
|
|
static_assert(sizeof...(Owned) + sizeof...(Get) + sizeof...(Exclude) > 1, "Single component groups are not allowed");
|
|
|
|
|
|
@@ -1343,7 +1342,7 @@ public:
|
|
|
|
|
|
/*! @copydoc group */
|
|
|
template<typename... Owned, typename... Get, typename... Exclude>
|
|
|
- [[nodiscard]] basic_group<entity_type, owned_t<std::add_const_t<Owned>...>, get_t<std::add_const_t<Get>...>, exclude_t<Exclude...>> group_if_exists(get_t<Get...>, exclude_t<Exclude...> = {}) const {
|
|
|
+ [[nodiscard]] basic_group<entity_type, owned_t<std::add_const_t<Owned>...>, get_t<std::add_const_t<Get>...>, exclude_t<Exclude...>> group_if_exists(get_t<Get...> = {}, exclude_t<Exclude...> = {}) const {
|
|
|
auto it = std::find_if(groups.cbegin(), groups.cend(), [](const auto &gdata) {
|
|
|
return gdata.size == (sizeof...(Owned) + sizeof...(Get) + sizeof...(Exclude))
|
|
|
&& (gdata.owned(type_hash<std::remove_const_t<Owned>>::value()) && ...)
|
|
|
@@ -1359,18 +1358,6 @@ public:
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /*! @copydoc group */
|
|
|
- template<typename... Owned, typename... Exclude>
|
|
|
- [[nodiscard]] basic_group<entity_type, owned_t<Owned...>, get_t<>, exclude_t<Exclude...>> group(exclude_t<Exclude...> = {}) {
|
|
|
- return group<Owned...>(get_t<>{}, exclude<Exclude...>);
|
|
|
- }
|
|
|
-
|
|
|
- /*! @copydoc group */
|
|
|
- template<typename... Owned, typename... Exclude>
|
|
|
- [[nodiscard]] basic_group<entity_type, owned_t<std::add_const_t<Owned>...>, get_t<>, exclude_t<Exclude...>> group_if_exists(exclude_t<Exclude...> = {}) const {
|
|
|
- return group_if_exists<std::add_const_t<Owned>...>(get_t<>{}, exclude<Exclude...>);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* @brief Checks whether the given components belong to any group.
|
|
|
* @tparam Component Types of components in which one is interested.
|