Skip to content

Commit

Permalink
doc: more about signals - close #1169
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Sep 13, 2024
1 parent d62204d commit dce9abb
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions docs/md/entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,19 +376,17 @@ In all cases, the function type of a listener is equivalent to the following:
void(entt::registry &, entt::entity);
```

In all cases, listeners are provided with the registry that triggered the
notification and the involved entity.
All listeners are provided with the registry that triggered the notification and
the involved entity. Note also that:

Note also that:

* Listeners for the construction signals are invoked **after** components have
been assigned to entities.
* Listeners for construction signals are invoked **after** components have been
created.

* Listeners designed to observe changes are invoked **after** components have
been updated.

* Listeners for the destruction signals are invoked **before** components have
been removed from entities.
* Listeners for destruction signals are invoked **before** components have been
destroyed.

There are also some limitations on what a listener can and cannot do:

Expand Down Expand Up @@ -435,7 +433,11 @@ registry.patch<entt::entity>(entity);
```

Destroying an entity and then updating the version of an identifier **does not**
give rise to these types of signals under any circumstances instead.
give rise to these types of signals under any circumstances instead.<br/>
Finally, note that listeners that _observe_ the destruction of an entity are
invoked **after** all components have been removed, not **before**. This is
because the entity would be invalidated before deleting its elements otherwise,
making it difficult for the user to write component listeners.

### Listeners disconnection

Expand Down

0 comments on commit dce9abb

Please sign in to comment.