|
|
@@ -45,7 +45,7 @@ class basic_registry {
|
|
|
struct pool_data {
|
|
|
type_info info{};
|
|
|
std::unique_ptr<basic_sparse_set<Entity>> pool{};
|
|
|
- void(* erase)(basic_sparse_set<Entity> &, basic_registry &, const Entity *, const Entity *){};
|
|
|
+ void(* remove)(basic_sparse_set<Entity> &, basic_registry &, const Entity *, const Entity *){};
|
|
|
};
|
|
|
|
|
|
template<typename...>
|
|
|
@@ -114,8 +114,8 @@ class basic_registry {
|
|
|
if(auto &&pdata = pools[index]; !pdata.pool) {
|
|
|
pdata.info = type_id<Component>();
|
|
|
pdata.pool.reset(new pool_t<Entity, Component>());
|
|
|
- pdata.erase = +[](basic_sparse_set<Entity> &cpool, basic_registry &owner, const Entity *first, const Entity *last) {
|
|
|
- static_cast<pool_t<Entity, Component> &>(cpool).erase(owner, first, last);
|
|
|
+ pdata.remove = +[](basic_sparse_set<Entity> &cpool, basic_registry &owner, const Entity *first, const Entity *last) {
|
|
|
+ static_cast<pool_t<Entity, Component> &>(cpool).remove(owner, first, last);
|
|
|
};
|
|
|
}
|
|
|
|
|
|
@@ -703,14 +703,12 @@ public:
|
|
|
* component.
|
|
|
*
|
|
|
* @tparam Component Types of components to remove.
|
|
|
- * @tparam Args Types of arguments to forward to the storage classes.
|
|
|
* @param entity A valid entity identifier.
|
|
|
- * @param args Optional parameters to forward to the storage classes.
|
|
|
*/
|
|
|
- template<typename... Component, typename... Args>
|
|
|
- void remove(const entity_type entity, Args &&... args) {
|
|
|
+ template<typename... Component>
|
|
|
+ void remove(const entity_type entity) {
|
|
|
ENTT_ASSERT(valid(entity));
|
|
|
- (assure<Component>().remove(*this, entity, std::forward<Args>(args)...), ...);
|
|
|
+ (assure<Component>().remove(*this, entity), ...);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -724,9 +722,9 @@ public:
|
|
|
* @param last An iterator past the last element of the range of entities.
|
|
|
*/
|
|
|
template<typename... Component, typename It>
|
|
|
- void erase(It first, It last) {
|
|
|
+ void remove(It first, It last) {
|
|
|
ENTT_ASSERT(std::all_of(first, last, [this](const auto entity) { return valid(entity); }));
|
|
|
- (assure<Component>().erase(*this, first, last), ...);
|
|
|
+ (assure<Component>().remove(*this, first, last), ...);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -780,7 +778,7 @@ public:
|
|
|
|
|
|
for(auto pos = pools.size(); pos; --pos) {
|
|
|
if(auto &pdata = pools[pos-1]; pdata.pool && pdata.pool->contains(entity)) {
|
|
|
- pdata.erase(*pdata.pool, *this, std::begin(wrap), std::end(wrap));
|
|
|
+ pdata.remove(*pdata.pool, *this, std::begin(wrap), std::end(wrap));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -937,7 +935,7 @@ public:
|
|
|
if constexpr(sizeof...(Component) == 0) {
|
|
|
for(auto pos = pools.size(); pos; --pos) {
|
|
|
if(const auto &pdata = pools[pos-1]; pdata.pool) {
|
|
|
- pdata.erase(*pdata.pool, *this, pdata.pool->rbegin(), pdata.pool->rend());
|
|
|
+ pdata.remove(*pdata.pool, *this, pdata.pool->rbegin(), pdata.pool->rend());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -948,7 +946,7 @@ public:
|
|
|
}
|
|
|
} else {
|
|
|
([this](auto &&cpool) {
|
|
|
- cpool.erase(*this, cpool.basic_sparse_set<entity_type>::begin(), cpool.basic_sparse_set<entity_type>::end());
|
|
|
+ cpool.remove(*this, cpool.basic_sparse_set<entity_type>::begin(), cpool.basic_sparse_set<entity_type>::end());
|
|
|
}(assure<Component>()), ...);
|
|
|
}
|
|
|
}
|