lib.cpp 742 B

1234567891011121314151617181920212223
  1. #include <entt/config/config.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/value_type.h"
  7. #include "lib.h"
  8. template class entt::basic_registry<entt::entity>;
  9. ENTT_API void update(entt::registry &registry, int value) {
  10. registry.view<test::boxed_int, test::empty>().each([value](auto &elem) {
  11. elem.value += value;
  12. });
  13. }
  14. ENTT_API void insert(entt::registry &registry) {
  15. // forces the creation of the pool for the empty type
  16. static_cast<void>(registry.storage<test::empty>());
  17. const auto view = registry.view<test::boxed_int>();
  18. registry.insert<test::empty>(view.begin(), view.end());
  19. }