Browse Source

group: minor changes

Michele Caini 3 years ago
parent
commit
f8a997e6c5
2 changed files with 7 additions and 7 deletions
  1. 2 2
      src/entt/entity/group.hpp
  2. 5 5
      src/entt/entity/registry.hpp

+ 2 - 2
src/entt/entity/group.hpp

@@ -142,7 +142,7 @@ public:
         }
     }
 
-    void remove(const entity_type entt) {
+    void remove_if(const entity_type entt) {
         if(std::get<0>(pools)->contains(entt) && (std::get<0>(pools)->index(entt) < len)) {
             swap_elements(std::index_sequence_for<Owned...>{}, --len, entt);
         }
@@ -202,7 +202,7 @@ public:
         }
     }
 
-    void remove(const entity_type entt) {
+    void remove_if(const entity_type entt) {
         elem.remove(entt);
     }
 

+ 5 - 5
src/entt/entity/registry.hpp

@@ -1216,8 +1216,8 @@ public:
             (on_construct<std::remove_const_t<Get>>().template connect<&handler_type::push_on_construct>(*handler), ...);
             (on_destroy<std::remove_const_t<Exclude>>().template connect<&handler_type::push_on_destroy>(*handler), ...);
 
-            (on_destroy<std::remove_const_t<Get>>().template connect<&handler_type::remove>(*handler), ...);
-            (on_construct<std::remove_const_t<Exclude>>().template connect<&handler_type::remove>(*handler), ...);
+            (on_destroy<std::remove_const_t<Get>>().template connect<&handler_type::remove_if>(*handler), ...);
+            (on_construct<std::remove_const_t<Exclude>>().template connect<&handler_type::remove_if>(*handler), ...);
 
             for(const auto entity: view<Get...>(exclude<Exclude...>)) {
                 handler->group().push(entity);
@@ -1251,9 +1251,9 @@ public:
             (on_construct<std::remove_const_t<Get>>().before(*next).template connect<&handler_type::push_on_construct>(*handler), ...);
             (on_destroy<std::remove_const_t<Exclude>>().before(*next).template connect<&handler_type::push_on_destroy>(*handler), ...);
 
-            (on_destroy<std::remove_const_t<Owned>>().before(*prev).template connect<&handler_type::remove>(*handler), ...);
-            (on_destroy<std::remove_const_t<Get>>().before(*prev).template connect<&handler_type::remove>(*handler), ...);
-            (on_construct<std::remove_const_t<Exclude>>().before(*prev).template connect<&handler_type::remove>(*handler), ...);
+            (on_destroy<std::remove_const_t<Owned>>().before(*prev).template connect<&handler_type::remove_if>(*handler), ...);
+            (on_destroy<std::remove_const_t<Get>>().before(*prev).template connect<&handler_type::remove_if>(*handler), ...);
+            (on_construct<std::remove_const_t<Exclude>>().before(*prev).template connect<&handler_type::remove_if>(*handler), ...);
 
             auto &cpool = assure<type_list_element_t<0u, type_list<std::remove_const_t<Owned>...>>>();