mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-06-19 11:16:37 +02:00
change scene engine from pointer to reference
This commit is contained in:
@ -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);
|
||||
|
@ -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
|
||||
|
||||
|
@ -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>();
|
||||
|
Reference in New Issue
Block a user