#pragma once #include #include #include #include #include #include "game/state_modify.hpp" #include "game/state_playing.hpp" #include "game/state_menu_main.hpp" #include "audio/audio.hpp" class Input; class AnimatedCursor; enum class NewGameState_e { NONE, NEW, LOAD }; // Game class encapsulating SDL initialization and loop class Game { public: Game(); Game(Game&&); ~Game(); SDL_Rect win_size = {0,0,800, 600}; SDL_Window* window = nullptr; SDL_Renderer* renderer = nullptr; Audio* audio = nullptr; AnimatedCursor* cursor = nullptr; bool is_cheating = false; std::unique_ptr state_playing; GameState* state_current = nullptr; GameState_e state_current_e = GameState_e::STATE_MENU_MAIN; std::unique_ptr state_temp; std::string active_game_dir = "game_saves"; bool draw_frames = false; Uint64 lastTicks; bool running; Input input; bool state_changed = false; void set_State(GameState_e state, NewGameState_e game_state_e = NewGameState_e::NONE); void Run(); bool Save(const std::string &path) const; bool Load(const std::string &path); private: void handle_Events(); void Update(); void Render(); };