#pragma once

#include "state.h"
#include "core/music.h"
#include "core/game.h"
#include "core/corefactory.h"
#include "core/functional.h"

class Group;

class GameState : public GUIState
{
public:

    struct Callbacks
    {
        kku::lambda onLeaveGame;
    };


    explicit GameState(const std::shared_ptr<kku::CoreFactory>& core_factory, const std::shared_ptr<kku::Game>& game, Callbacks&& callbacks);

    virtual void input(const kku::SystemEvent& event) override;
    virtual void update(const kku::microsec& dt) override;
    virtual void display() const override;

    virtual void enter() override;
    virtual void leave() override;

private:
    const std::shared_ptr<kku::CoreFactory> _core_factory;
    std::shared_ptr<kku::Music> _music;
    std::shared_ptr<kku::Game> _game;

    kku::lambda _onEnterGameCallback;
    kku::lambda _onLeaveGameCallback;
};

