another_module.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include <entt/entity/registry.hpp>
  2. #include "component.h"
  3. #ifndef LIB_EXPORT
  4. #if defined _WIN32 || defined __CYGWIN__
  5. #define LIB_EXPORT __declspec(dllexport)
  6. #elif defined __GNUC__
  7. #define LIB_EXPORT __attribute__((visibility("default")))
  8. #else
  9. #define LIB_EXPORT
  10. #endif
  11. #endif
  12. ENTT_SHARED_TYPE(int)
  13. ENTT_SHARED_TYPE(char)
  14. ENTT_SHARED_TYPE(double)
  15. ENTT_SHARED_TYPE(float)
  16. LIB_EXPORT typename entt::registry<>::component_type another_module_int_type() {
  17. entt::registry<> registry;
  18. (void)registry.type<char>();
  19. (void)registry.type<const int>();
  20. (void)registry.type<double>();
  21. (void)registry.type<const char>();
  22. (void)registry.type<float>();
  23. return registry.type<int>();
  24. }
  25. LIB_EXPORT typename entt::registry<>::component_type another_module_char_type() {
  26. entt::registry<> registry;
  27. (void)registry.type<int>();
  28. (void)registry.type<const char>();
  29. (void)registry.type<float>();
  30. (void)registry.type<const int>();
  31. (void)registry.type<double>();
  32. return registry.type<char>();
  33. }
  34. LIB_EXPORT void assign_velocity(int vel, entt::registry<> &registry) {
  35. for(auto entity: registry.view<position>()) {
  36. registry.assign<velocity>(entity, vel, vel);
  37. }
  38. }