소스 검색

doc: minor changes

Michele Caini 2 년 전
부모
커밋
aa7a7ce25a
1개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  1. 8 8
      docs/md/entity.md

+ 8 - 8
docs/md/entity.md

@@ -349,16 +349,16 @@ when a new instance of a given component type is created:
 
 ```cpp
 // connects a free function
-registry.storage<position>().on_construct().connect<&my_free_function>();
+registry.on_construct<position>().connect<&my_free_function>();
 
 // connects a member function
-registry.storage<position>().on_construct().connect<&my_class::member>(instance);
+registry.on_construct<position>().connect<&my_class::member>(instance);
 
 // disconnects a free function
-registry.storage<position>().on_construct().disconnect<&my_free_function>();
+registry.on_construct<position>().disconnect<&my_free_function>();
 
 // disconnects a member function
-registry.storage<position>().on_construct().disconnect<&my_class::member>(instance);
+registry.on_construct<position>().disconnect<&my_class::member>(instance);
 ```
 
 Similarly, `on_destroy` and `on_update` are used to receive notifications about
@@ -672,20 +672,20 @@ For example, the following adds (or replaces) the component `a_type` whenever
 `my_type` is assigned to an entity:
 
 ```cpp
-registry.storage<my_type>().on_construct().connect<&entt::registry::emplace_or_replace<a_type>>();
+registry.on_construct<my_type>().connect<&entt::registry::emplace_or_replace<a_type>>();
 ```
 
 Similarly, the code below removes `a_type` from an entity whenever `my_type` is
 assigned to it:
 
 ```cpp
-registry.storage<my_type>().on_construct().connect<&entt::registry::remove<a_type>>();
+registry.on_construct<my_type>().connect<&entt::registry::remove<a_type>>();
 ```
 
 A dependency is easily _broken_ as follows:
 
 ```cpp
-registry.storage<my_type>().on_construct().disconnect<&entt::registry::emplace_or_replace<a_type>>();
+registry.on_construct<my_type>().disconnect<&entt::registry::emplace_or_replace<a_type>>();
 ```
 
 There are many other types of _dependencies_. In general, most of the functions
@@ -698,7 +698,7 @@ The `invoke` helper allows to _propagate_ a signal to a member function of a
 component without having to _extend_ it:
 
 ```cpp
-registry.storage<clazz>().on_construct().connect<entt::invoke<&clazz::func>>();
+registry.on_construct<clazz>().connect<entt::invoke<&clazz::func>>();
 ```
 
 All it does is pick up the _right_ component for the received entity and invoke