|
@@ -367,12 +367,18 @@ public:
|
|
|
*
|
|
*
|
|
|
* @param entt A valid entity identifier.
|
|
* @param entt A valid entity identifier.
|
|
|
*/
|
|
*/
|
|
|
- void construct(const entity_type entt) {
|
|
|
|
|
|
|
+ void emplace(const entity_type entt) {
|
|
|
ENTT_ASSERT(!has(entt));
|
|
ENTT_ASSERT(!has(entt));
|
|
|
assure(page(entt))[offset(entt)] = entity_type(direct.size());
|
|
assure(page(entt))[offset(entt)] = entity_type(direct.size());
|
|
|
direct.push_back(entt);
|
|
direct.push_back(entt);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /*! @copydoc emplace */
|
|
|
|
|
+ [[deprecated("use ::emplace instead")]]
|
|
|
|
|
+ void construct(const entity_type entt) {
|
|
|
|
|
+ emplace(entt);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief Assigns one or more entities to a sparse set.
|
|
* @brief Assigns one or more entities to a sparse set.
|
|
|
*
|
|
*
|
|
@@ -387,7 +393,7 @@ public:
|
|
|
* @param last An iterator past the last element of the range of entities.
|
|
* @param last An iterator past the last element of the range of entities.
|
|
|
*/
|
|
*/
|
|
|
template<typename It>
|
|
template<typename It>
|
|
|
- void construct(It first, It last) {
|
|
|
|
|
|
|
+ void insert(It first, It last) {
|
|
|
std::for_each(first, last, [this, next = direct.size()](const auto entt) mutable {
|
|
std::for_each(first, last, [this, next = direct.size()](const auto entt) mutable {
|
|
|
ENTT_ASSERT(!has(entt));
|
|
ENTT_ASSERT(!has(entt));
|
|
|
assure(page(entt))[offset(entt)] = entity_type(next++);
|
|
assure(page(entt))[offset(entt)] = entity_type(next++);
|
|
@@ -396,6 +402,13 @@ public:
|
|
|
direct.insert(direct.end(), first, last);
|
|
direct.insert(direct.end(), first, last);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /*! @copydoc insert */
|
|
|
|
|
+ template<typename It>
|
|
|
|
|
+ [[deprecated("use ::insert instead")]]
|
|
|
|
|
+ void construct(It first, It last) {
|
|
|
|
|
+ insert(std::move(first), std::move(last));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief Removes an entity from a sparse set.
|
|
* @brief Removes an entity from a sparse set.
|
|
|
*
|
|
*
|