|
|
@@ -1281,7 +1281,7 @@ thrown away. The reasons for this go far beyond the scope of this document.<br/>
|
|
|
To iterate a runtime view, either use it in a range-for loop:
|
|
|
|
|
|
```cpp
|
|
|
-entt::component types[] = { entt::type_info<position>::id(), entt::type_info<velocity>::id() };
|
|
|
+entt::id_type types[] = { entt::type_info<position>::id(), entt::type_info<velocity>::id() };
|
|
|
auto view = registry.runtime_view(std::cbegin(types), std::cend(types));
|
|
|
|
|
|
for(auto entity: view) {
|
|
|
@@ -1299,7 +1299,7 @@ for(auto entity: view) {
|
|
|
Or rely on the `each` member function to iterate entities:
|
|
|
|
|
|
```cpp
|
|
|
-entt::component types[] = { entt::type_info<position>::id(), entt::type_info<velocity>::id() };
|
|
|
+entt::id_type types[] = { entt::type_info<position>::id(), entt::type_info<velocity>::id() };
|
|
|
|
|
|
registry.runtime_view(std::cbegin(types), std::cend(types)).each([](auto entity) {
|
|
|
// ...
|
|
|
@@ -1310,8 +1310,8 @@ Performance are exactly the same in both cases.<br/>
|
|
|
Filtering entities by components is also supported for this kind of views:
|
|
|
|
|
|
```cpp
|
|
|
-entt::component components[] = { entt::type_info<position>::id() };
|
|
|
-entt::component filter[] = { entt::type_info<velocity>::id() };
|
|
|
+entt::id_type components[] = { entt::type_info<position>::id() };
|
|
|
+entt::id_type filter[] = { entt::type_info<velocity>::id() };
|
|
|
auto view = registry.runtime_view(std::cbegin(components), std::cend(components), std::cbegin(filter), std::cend(filter));
|
|
|
```
|
|
|
|