Michele Caini 5 лет назад
Родитель
Сommit
f24bb8737d
3 измененных файлов с 2 добавлено и 22 удалено
  1. 0 20
      docs/md/entity.md
  2. 1 1
      src/entt/entity/actor.hpp
  3. 1 1
      src/entt/entity/fwd.hpp

+ 0 - 20
docs/md/entity.md

@@ -21,7 +21,6 @@
     * [Null entity](#null-entity)
     * [Dependencies](#dependencies)
     * [Invoke](#invoke)
-    * [Actor](#actor)
     * [Context variables](#context-variables)
   * [Meet the runtime](#meet-the-runtime)
     * [Cloning a registry](#cloning-a-registry)
@@ -643,25 +642,6 @@ registry.on_construct<clazz>().connect<entt::invoke<&clazz::func>>();
 All it does is pick up the _right_ component for the received entity and invoke
 the requested method, passing on the arguments if necessary.
 
-### Actor
-
-The `actor` class is designed for those who don't feel immediately comfortable
-working with components or for those who are migrating a project and want to
-approach it one step at a time.
-
-This class acts as a thin wrapper for an entity and for all its components. It's
-constructed with a registry and is in charge of the destruction of the entity
-when it goes out of the scope.<br/>
-An actor offers all the functionalities required to work with components, such
-as the `assign` and` remove` member functions, but also `has`,` get`, `try_get`
-and so on.
-
-My advice isn't to use the `actor` class to hide entities and components behind
-a more object-oriented interface. Instead, users should rely on it only where
-strictly necessary. In all other cases, it's highly advisable to become familiar
-with the model of `EnTT` and work directly with the registry, the views and the
-groups, rather than with a tool that could introduce a performance degradation.
-
 ### Context variables
 
 It is often convenient to assign context variables to a registry, so as to make

+ 1 - 1
src/entt/entity/actor.hpp

@@ -24,7 +24,7 @@ namespace entt {
  * @tparam Entity A valid entity type (see entt_traits for more details).
  */
 template<typename Entity>
-struct basic_actor {
+struct [[deprecated("Consider using the handle class instead")]] basic_actor {
     /*! @brief Type of registry used internally. */
     using registry_type = basic_registry<Entity>;
     /*! @brief Underlying entity identifier. */

+ 1 - 1
src/entt/entity/fwd.hpp

@@ -54,7 +54,7 @@ using registry = basic_registry<entity>;
 using observer = basic_observer<entity>;
 
 /*! @brief Alias declaration for the most common use case. */
-using actor = basic_actor<entity>;
+using actor [[deprecated("Consider using the handle class instead")]] = basic_actor<entity>;
 
 /*! @brief Alias declaration for the most common use case. */
 using snapshot = basic_snapshot<entity>;