updated doc (see #277)

This commit is contained in:
Michele Caini
2019-07-09 14:56:25 +02:00
parent d63b78f0e7
commit 9a10ee0efa

View File

@@ -24,6 +24,7 @@
* [Archives](#archives)
* [One example to rule them all](#one-example-to-rule-them-all)
* [Prototype](#prototype)
* [The actor class](#the-actor-class)
* [Helpers](#helpers)
* [Dependency function](#dependency-function)
* [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
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
The so called _helpers_ are small classes and functions mainly designed to offer