|
|
@@ -99,14 +99,13 @@ struct group_handler<owned_t<Owned...>, get_t<Get...>, exclude_t<Exclude...>> {
|
|
|
static_assert(!std::disjunction_v<std::bool_constant<Owned::traits_type::in_place_delete>...>, "Groups do not support in-place delete");
|
|
|
static_assert(!std::disjunction_v<std::is_const<Owned>..., std::is_const<Get>..., std::is_const<Exclude>...>, "Const storage type not allowed");
|
|
|
|
|
|
- using underlying_type = std::common_type_t<typename Owned::entity_type..., typename Get::entity_type..., typename Exclude::entity_type...>;
|
|
|
- using basic_common_type = std::common_type_t<typename Owned::base_type..., typename Get::base_type..., typename Exclude::base_type...>;
|
|
|
+ using entity_type = std::common_type_t<typename Owned::entity_type..., typename Get::entity_type..., typename Exclude::entity_type...>;
|
|
|
|
|
|
group_handler(Owned &...opool, Get &...gpool, Exclude &...epool)
|
|
|
: pools{&opool..., &gpool..., &epool...} {}
|
|
|
|
|
|
template<typename Type>
|
|
|
- void maybe_valid_if(const underlying_type entt) {
|
|
|
+ void maybe_valid_if(const entity_type entt) {
|
|
|
if(((std::is_same_v<Type, Owned> || std::get<Owned *>(pools)->contains(entt)) && ...)
|
|
|
&& ((std::is_same_v<Type, Get> || std::get<Get *>(pools)->contains(entt)) && ...)
|
|
|
&& ((std::is_same_v<Type, Exclude> || !std::get<Exclude *>(pools)->contains(entt)) && ...)
|
|
|
@@ -116,7 +115,7 @@ struct group_handler<owned_t<Owned...>, get_t<Get...>, exclude_t<Exclude...>> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void discard_if(const underlying_type entt) {
|
|
|
+ void discard_if(const entity_type entt) {
|
|
|
if(std::get<0>(pools)->contains(entt) && (std::get<0>(pools)->index(entt) < current)) {
|
|
|
const auto pos = --current;
|
|
|
(std::get<Owned *>(pools)->swap_elements(std::get<Owned *>(pools)->data()[pos], entt), ...);
|
|
|
@@ -133,7 +132,7 @@ struct group_handler<owned_t<>, get_t<Get...>, exclude_t<Exclude...>>: std::comm
|
|
|
// nasty workaround for an issue with the toolset v141 that doesn't accept a fold expression here
|
|
|
static_assert(!std::disjunction_v<std::is_const<Get>..., std::is_const<Exclude>...>, "Const storage type not allowed");
|
|
|
|
|
|
- using underlying_type = std::common_type_t<typename Get::entity_type..., typename Exclude::entity_type...>;
|
|
|
+ using entity_type = std::common_type_t<typename Get::entity_type..., typename Exclude::entity_type...>;
|
|
|
using basic_common_type = std::common_type_t<typename Get::base_type..., typename Exclude::base_type...>;
|
|
|
|
|
|
template<typename Alloc>
|
|
|
@@ -142,7 +141,7 @@ struct group_handler<owned_t<>, get_t<Get...>, exclude_t<Exclude...>>: std::comm
|
|
|
pools{&gpool..., &epool...} {}
|
|
|
|
|
|
template<typename Type>
|
|
|
- void maybe_valid_if(const underlying_type entt) {
|
|
|
+ void maybe_valid_if(const entity_type entt) {
|
|
|
if(((std::is_same_v<Type, Get> || std::get<Get *>(pools)->contains(entt)) && ...)
|
|
|
&& ((std::is_same_v<Type, Exclude> || !std::get<Exclude *>(pools)->contains(entt)) && ...)
|
|
|
&& !basic_common_type::contains(entt)) {
|
|
|
@@ -150,7 +149,7 @@ struct group_handler<owned_t<>, get_t<Get...>, exclude_t<Exclude...>>: std::comm
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void discard_if(const underlying_type entt) {
|
|
|
+ void discard_if(const entity_type entt) {
|
|
|
basic_common_type::remove(entt);
|
|
|
}
|
|
|
|