lib.cpp 638 B

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