R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
VictoryMenu.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2026
3** r-type
4** File description:
5** VictoryMenu - Victory screen
6*/
7
8#pragma once
9
10#include <functional>
11#include <memory>
12#include <string>
13
14#include "Menu/BaseMenu.hpp"
15#include "UI/IUIFactory.hpp"
16
17namespace Game {
23 class VictoryMenu : public BaseMenu {
24 public:
29 explicit VictoryMenu(UI::IUIFactory &uiFactory);
30 ~VictoryMenu() override = default;
31
35 void Initialize() override;
36
40 void SetOnReturnToMenu(std::function<void()> callback);
41
46 void SetVictoryMessage(const std::string &message);
47
51 void Render() override;
52
53 private:
55
56 std::function<void()> _onReturnToMenu{};
57 std::string _victoryMessage{"VICTORY!"};
58 };
59} // namespace Game
Base class for all menu implementations.
Definition BaseMenu.hpp:26
Victory screen displayed when the player wins the level.
std::function< void()> _onReturnToMenu
void SetOnReturnToMenu(std::function< void()> callback)
Set callback invoked when user clicks return to menu button.
void Render() override
Custom render to display victory message.
void Initialize() override
Initialize UI elements (creates buttons and text).
void OnReturnToMenuClicked()
void SetVictoryMessage(const std::string &message)
Set the victory message to display.
~VictoryMenu() override=default
std::string _victoryMessage
Abstract factory interface for creating UI elements.