lib.cpp 723 B

12345678910111213141516171819202122
  1. #include <entt/config/attribute.h>
  2. #include <entt/entity/mixin.hpp>
  3. #include <entt/entity/registry.hpp>
  4. #include <entt/entity/view.hpp>
  5. #include "../../../common/boxed_type.h"
  6. #include "../../../common/empty.h"
  7. template class entt::basic_registry<entt::entity>;
  8. ENTT_API void update(entt::registry &registry, int value) {
  9. registry.view<test::boxed_int, test::empty>().each([value](auto &elem) {
  10. elem.value += value;
  11. });
  12. }
  13. ENTT_API void insert(entt::registry &registry) {
  14. // forces the creation of the pool for the empty type
  15. static_cast<void>(registry.storage<test::empty>());
  16. const auto view = registry.view<test::boxed_int>();
  17. registry.insert<test::empty>(view.begin(), view.end());
  18. }