Просмотр исходного кода

basic_continuous_loader: deprecated ::has, use ::contains instead

Michele Caini 6 лет назад
Родитель
Сommit
a7faab53b9
2 измененных файлов с 7 добавлено и 2 удалено
  1. 0 1
      TODO
  2. 7 1
      src/entt/entity/snapshot.hpp

+ 0 - 1
TODO

@@ -17,7 +17,6 @@
   - get -> all, exclude -> none
   - get -> all, exclude -> none
 
 
 Next:
 Next:
-* has -> contains and destroy -> erase for containers (sparse_set, storage, observer, snapshot)?
 * meta, make it possible to reset nodes from meta types
 * meta, make it possible to reset nodes from meta types
 * replace observer class with observer functions
 * replace observer class with observer functions
 * get(cmp, entity) -> void *, set(cmp, entity, void *)
 * get(cmp, entity) -> void *, set(cmp, entity, void *)

+ 7 - 1
src/entt/entity/snapshot.hpp

@@ -573,10 +573,16 @@ public:
      * @param entt An entity identifier.
      * @param entt An entity identifier.
      * @return True if `entity` is managed by the loader, false otherwise.
      * @return True if `entity` is managed by the loader, false otherwise.
      */
      */
-    bool has(entity_type entt) const ENTT_NOEXCEPT {
+    bool contains(entity_type entt) const ENTT_NOEXCEPT {
         return (remloc.find(entt) != remloc.cend());
         return (remloc.find(entt) != remloc.cend());
     }
     }
 
 
+    /*! @copydoc contains */
+    [[deprecated("use ::contains instead")]]
+    bool has(entity_type entt) const ENTT_NOEXCEPT {
+        return contains(entt);
+    }
+
     /**
     /**
      * @brief Returns the identifier to which an entity refers.
      * @brief Returns the identifier to which an entity refers.
      * @param entt An entity identifier.
      * @param entt An entity identifier.