From a9852bd2c5a601f9f9c58b1dff60e9130587657b Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 20 Mar 2022 14:09:48 +0100 Subject: refactor: move on start & on exit details to the game class --- src/game/game.hpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/game/game.hpp') diff --git a/src/game/game.hpp b/src/game/game.hpp index 9ec5b41..2493a42 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -1,6 +1,5 @@ #pragma once -#include "DI/auto_wirable.hpp" #include "interfaces/cursor.hpp" #include "interfaces/game.hpp" #include "interfaces/scene.hpp" @@ -8,16 +7,21 @@ #include -class Game : public IGame, public AutoWirable +class Game : public IGame { public: - Game() noexcept = default; + Game(const std::shared_ptr &window, const std::shared_ptr &scene, + const std::shared_ptr &cursor_controller) noexcept; - void run() noexcept override; + void on_start() noexcept override; + + void on_exit() const noexcept override; [[nodiscard]] std::unordered_map> - get_input_config(const std::shared_ptr &window, - const std::shared_ptr &scene, - const std::shared_ptr &cursor_controller) - const noexcept override; + get_input_config() const noexcept override; + +private: + const std::shared_ptr &_window; + const std::shared_ptr &_scene; + const std::shared_ptr &_cursor_controller; }; -- cgit v1.2.3-18-g5258