added a test that goes across boundaries

This commit is contained in:
Michele Caini
2019-02-23 00:53:07 +01:00
parent 6a09bf2c54
commit 33fddcb289
5 changed files with 55 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
#include <entt/entity/registry.hpp>
#include "component.h"
#ifndef LIB_EXPORT
#if defined _WIN32 || defined __CYGWIN__
@@ -32,3 +33,10 @@ LIB_EXPORT typename entt::registry<>::component_type a_module_char_type() {
return registry.type<char>();
}
LIB_EXPORT void update_position(int delta, entt::registry<> &registry) {
registry.view<position, velocity>().each([delta](auto &pos, auto &vel) {
pos.x += delta * vel.dx;
pos.y += delta * vel.dy;
});
}