Просмотр исходного кода

updated example in the README file (close #209)

Michele Caini 7 лет назад
Родитель
Сommit
f71496693f
2 измененных файлов с 4 добавлено и 4 удалено
  1. 3 3
      README.md
  2. 1 1
      TODO

+ 3 - 3
README.md

@@ -113,7 +113,7 @@ struct velocity {
     float dy;
 };
 
-void update(entt::registry<> &registry) {
+void update(entt::registry &registry) {
     auto view = registry.view<position, velocity>();
 
     for(auto entity: view) {
@@ -128,8 +128,8 @@ void update(entt::registry<> &registry) {
     }
 }
 
-void update(std::uint64_t dt, entt::registry<> &registry) {
-    registry.view<position, velocity>().each([dt](const auto, auto &pos, auto &vel) {
+void update(std::uint64_t dt, entt::registry &registry) {
+    registry.view<position, velocity>().each([dt](auto &pos, auto &vel) {
         // gets all the components of the view at once ...
 
         pos.x += vel.dx * dt;

+ 1 - 1
TODO

@@ -18,6 +18,6 @@
 * empty components model allows for shared components and prefabs unity-like
   - each with entity return the shared component multiple times, one per entity that refers to it
   - each components only return actual component, so shared components are returned only once
-* add a sort of "fast each" for when users know they are not to add/remove components, it can use directly raw access and improve even further performance
 * types defined at runtime that refer to the same compile-time type (but to different pools) are possible, the library is almost there
 * add take functionality, eg registry.take(entity, other); where it takes the entity and all its components from registry and move them to other
+* add unset for context variables