meta.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include <component/input_listener_component.h>
  2. #include <component/position_component.h>
  3. #include <component/rect_component.h>
  4. #include <component/renderable_component.h>
  5. #include <entt/meta/factory.hpp>
  6. #include <meta/meta.h>
  7. namespace testbed {
  8. void meta_setup() {
  9. entt::meta_factory<input_listener_component::type>()
  10. .type("command type")
  11. .data<input_listener_component::type::UP>("up")
  12. .data<input_listener_component::type::DOWN>("down")
  13. .data<input_listener_component::type::LEFT>("left")
  14. .data<input_listener_component::type::RIGHT>("right");
  15. entt::meta_factory<input_listener_component>()
  16. .type("input listener")
  17. .data<&input_listener_component::command>("command");
  18. entt::meta_factory<position_component>()
  19. .type("position")
  20. .data<&SDL_FPoint::x>("x")
  21. .data<&SDL_FPoint::y>("y");
  22. entt::meta_factory<rect_component>()
  23. .type("rect")
  24. .data<&SDL_FRect::x>("x")
  25. .data<&SDL_FRect::y>("y")
  26. .data<&SDL_FRect::w>("w")
  27. .data<&SDL_FRect::h>("h");
  28. entt::meta_factory<renderable_component>()
  29. .type("renderable");
  30. }
  31. } // namespace testbed