diff --git a/libs/ecs/include/psemek/ecs/entity_container.hpp b/libs/ecs/include/psemek/ecs/entity_container.hpp index 4a66bf33..c7f76bf3 100644 --- a/libs/ecs/include/psemek/ecs/entity_container.hpp +++ b/libs/ecs/include/psemek/ecs/entity_container.hpp @@ -36,8 +36,7 @@ namespace psemek::ecs entity_handle create(Components && ... components); /** Check if an entity handle refers to an alive entity (i.e. one that wasn't - * destroyed yet. - * Destroying an entity invalidates all previously created entity accessors. + * destroyed yet). * If the handle wasn't previously obtained by a `create()` call, the * behavior is undefined. */ @@ -53,12 +52,13 @@ namespace psemek::ecs */ void destroy(entity_handle const & entity); - /** Get an entity accessor for an entity, which provides access to - * the entitie's components. + /** Get an entity accessor for an entity, which provides access to the entity's components. + * It is designed to be a single-use object; it cannot be stored as a reference to + * the entity. Use entity_handle for that instead. + * Creating or destroying entities, as well as attaching or detaching components, + * invalidates all previously created entity accessors. * If the handle wasn't previously obtained by a `create()` call, or - * the refered entity was already destroyed, the behavior is undefined. - * Creating or destroying entities invalidates all previously created - * entity accessors. + * the referred entity was already destroyed, the behavior is undefined. */ entity_accessor get(entity_handle const & entity); @@ -89,8 +89,7 @@ namespace psemek::ecs template void detach(entity_handle const & entity); - /** Create a query cache that can be used for speeding up - * the `apply()` calls. + /** Create a query cache that can be used to speed up `apply()` calls. */ template query_cache cache();