change scene engine from pointer to reference

This commit is contained in:
2022-02-08 21:06:22 +01:00
parent a8b3b25e7d
commit a2b056f385
4 changed files with 9 additions and 6 deletions

View File

@ -6,10 +6,10 @@
namespace MM::Systems {
void player_velocity2d(entt::view<entt::get_t<const MM::Input::PlayerID, MM::Components::Velocity2DPositionIntent>> view, const MM::Engine* engine) {
void player_velocity2d(entt::view<entt::get_t<const MM::Input::PlayerID, MM::Components::Velocity2DPositionIntent>> view, MM::Engine& engine) {
ZoneScopedN("MM::Systems::PlayerVelocity2D");
auto& input_ss = engine->getService<MM::Services::InputService>();
auto& input_ss = engine.getService<MM::Services::InputService>();
view.each([&input_ss](const MM::Input::PlayerID p_id, MM::Components::Velocity2DPositionIntent& v) {
v.intent = input_ss.getMoveVec(p_id);

View File

@ -7,7 +7,7 @@
namespace MM::Systems {
// this system transforms the input from the input_service into velocity intent
void player_velocity2d(entt::view<entt::get_t<const MM::Input::PlayerID, MM::Components::Velocity2DPositionIntent>> view, const MM::Engine* engine);
void player_velocity2d(entt::view<entt::get_t<const MM::Input::PlayerID, MM::Components::Velocity2DPositionIntent>> view, MM::Engine& engine);
} // MM::Systems

View File

@ -26,7 +26,7 @@ TEST(player_velocity, basic_run) {
bool provide_ret = engine.provide<MM::Services::SceneServiceInterface, MM::Services::OrganizerSceneService>();
ASSERT_TRUE(provide_ret);
auto& scene = engine.tryService<MM::Services::SceneServiceInterface>()->getScene();
auto& scene = engine.getService<MM::Services::SceneServiceInterface>().getScene();
// setup v system
auto& org = scene.set<entt::organizer>();