//
// Created by sebastian on 06.08.26.
//

#ifndef COLORRACE_LOBBYUILAYER_H
#define COLORRACE_LOBBYUILAYER_H
#include "layer/Layer.h"
#include "loader/assets/AssetManager.h"
#include "renderer/GuiRenderer.h"
#include "renderer/ui/GUITexture.h"


class LobbyUiLayer : public engine::Layer {
public:
    LobbyUiLayer(engine::Keyboard &keyboard, engine::Mouse &mouse,
        engine::EventBus<engine::animation::AnimationMarkerEvent> &animationEventBus, engine::AssetManager& assetManager)
        : Layer(keyboard, mouse, animationEventBus), m_assetManager(assetManager) {
    }

    LobbyUiLayer(engine::Keyboard &keyboard, engine::Mouse &mouse,
        engine::EventBus<engine::animation::AnimationMarkerEvent> &animationEventBus,
        const std::shared_ptr<engine::EventBus<std::variant<QuitRequested>>> &applicationEventBus, engine::AssetManager& assetManager)
        : Layer(keyboard, mouse, animationEventBus, applicationEventBus), m_assetManager(assetManager) {
    }

    void onRender() override;
    void onUpdate(float deltaTime) override;

protected:
    void onAttachImpl() override;
    void onDetachImpl() override;

private:
    std::unique_ptr<engine::GUITexture> backgroundImage;
    engine::AssetManager& m_assetManager;
    engine::renderer::GuiRenderer m_guiRenderer;
};


#endif //COLORRACE_LOBBYUILAYER_H
