#include #include #include #include #include #include #include #include TEST(player_velocity, basic_run) { float delta = 1/60.f; MM::Engine engine; engine.addService(); ASSERT_TRUE(engine.enableService()); engine.addService(); ASSERT_TRUE(engine.enableService()); engine.addService(delta); ASSERT_TRUE(engine.enableService()); bool provide_ret = engine.provide(); ASSERT_TRUE(provide_ret); auto& scene = engine.getService().getScene(); // setup v system auto& org = scene.ctx().emplace(); org.emplace<&MM::Systems::player_velocity2d>("player_velocity2d"); // HACK: instead you would switch to this scene engine.getService().updateOrganizerVertices(scene); //auto [e, t, v] = scene.create(); //t.position = { 0.f, 0.f }; //t.rotation = 0.f; //v.velocity = { 1.f, 1.f }; //v.rotation = 0.f; //engine.getUpdateStrategy().addDeferred([](auto& e) { e.stop(); }); //engine.run(); engine.update(); //ASSERT_EQ(t.position.x, 1.f * delta); // TODO: TEST }