#ifndef GAME_H
#define GAME_H

#include <memory>

#include <SFML/System/Time.hpp>

#include "hero.h"
#include "level.h"
#include "audio.h"
#include "renderer.h"

/// The main class where all the process happens
class Game
{
private:
    // Game entities
    HeroPtr hero;
    LevelPtr level;
    AudioPtr audio;
    std::unique_ptr<Renderer> renderer; // wer is `using RendererPrt = ...` A?A?A?

    int current_level;

    // SFML entities
    sf::RenderWindow main_window;

    /// Convert pressed key into a game direction
    Direction getDirection(sf::Keyboard::Key &key) const;

    /// Move player by pressed key
    void onMoving(sf::Keyboard::Key &key);

    /// Prepare map and hero for a game level
    //void loadLevel(int level_index = 1);

public:
    explicit Game();

    /// Start the game loop
    int run();
};

#endif // GAME_H
