Michele Caini 6 anni fa
parent
commit
9a10ee0efa
1 ha cambiato i file con 20 aggiunte e 0 eliminazioni
  1. 20 0
      docs/md/entity.md

+ 20 - 0
docs/md/entity.md

@@ -24,6 +24,7 @@
     * [Archives](#archives)
     * [Archives](#archives)
     * [One example to rule them all](#one-example-to-rule-them-all)
     * [One example to rule them all](#one-example-to-rule-them-all)
   * [Prototype](#prototype)
   * [Prototype](#prototype)
+  * [The actor class](#the-actor-class)
   * [Helpers](#helpers)
   * [Helpers](#helpers)
     * [Dependency function](#dependency-function)
     * [Dependency function](#dependency-function)
     * [Tags](#tags)
     * [Tags](#tags)
@@ -941,6 +942,25 @@ Furthermore, the codebase may be easier to maintain, since updating a prototype
 is much less error prone than jumping around in the codebase to update all the
 is much less error prone than jumping around in the codebase to update all the
 snippets copied and pasted around to initialize entities and components.
 snippets copied and pasted around to initialize entities and components.
 
 
+## The actor class
+
+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 to be used behind the scenes 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.
+
 ## Helpers
 ## Helpers
 
 
 The so called _helpers_ are small classes and functions mainly designed to offer
 The so called _helpers_ are small classes and functions mainly designed to offer