From a7faab53b95d182fc894c54c05b45100f0c3fb2b Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 7 Apr 2020 00:00:57 +0200 Subject: [PATCH] basic_continuous_loader: deprecated ::has, use ::contains instead --- TODO | 1 - src/entt/entity/snapshot.hpp | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index e11687d50..0d4fec5f2 100644 --- a/TODO +++ b/TODO @@ -17,7 +17,6 @@ - get -> all, exclude -> none Next: -* has -> contains and destroy -> erase for containers (sparse_set, storage, observer, snapshot)? * meta, make it possible to reset nodes from meta types * replace observer class with observer functions * get(cmp, entity) -> void *, set(cmp, entity, void *) diff --git a/src/entt/entity/snapshot.hpp b/src/entt/entity/snapshot.hpp index 867dd5c14..8fdfc4a36 100644 --- a/src/entt/entity/snapshot.hpp +++ b/src/entt/entity/snapshot.hpp @@ -573,10 +573,16 @@ public: * @param entt An entity identifier. * @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()); } + /*! @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. * @param entt An entity identifier.