//
// Created by sasha on 01.12.2025.
//

#ifndef RU_DANSOFT_PUZZLE15_MODAL_VICTORY_H
#define RU_DANSOFT_PUZZLE15_MODAL_VICTORY_H

#include "engine/widgets/iwidget.h"
#include "engine/widgets/image.h"
#include "engine/widgets/text.h"

#include "modal_victory/button_victory.h"
#include "modal_victory/label_info_victory.h"

class ModalVictory  : public IWidget {
    public:
        ModalVictory(IWidget *parent, float x, float y, const std::string &type);

        void setType(const std::string &type);
        void showVictory(int count_turn,int count_time);

        void onReplay(std::function<void()> func);
        void onMenu(std::function<void()> func);

        void showNewRecord(bool visible);

        void event(const SDL_Event &event) override;

    private:
        Image *dialog_shading;
        Image *image;
        Text *description;
        ButtonVictory *button_replay;
        ButtonVictory *button_menu;

        LabelInfoVictory *label_turn;
        LabelInfoVictory *label_time;

        Text *txtNewRecord;

        std::map<std::string,std::function<void()>> callbacks;
};


#endif //RU_DANSOFT_PUZZLE15_MODAL_VICTORY_H
