GigaPasjans
Loading...
Searching...
No Matches
WinScreen.h
1// Plik utworzony przez Piotra ChudziƄskiego w dniu 28.04.2025
2#pragma once
3
4#include <game/Screens/Screen.h>
5#include <andromenda/Components/TextComponent.h>
6
7namespace Game
8{
13 struct StatisticsEntry
14 {
20
26
31 std::function<String()> Supplier;
32
33 StatisticsEntry(const Int2 &position, const std::function<String()> &supplier);
34 StatisticsEntry(const StatisticsEntry &other);
35 StatisticsEntry(StatisticsEntry &&other) noexcept;
36
37 ~StatisticsEntry();
38 };
39
44 class WinScreen : public MenuScreen
45 {
46 private:
47 std::vector<StatisticsEntry> m_Statistics;
48 public:
49 WinScreen();
50 ~WinScreen() override;
51
52 static void Save();
53 static void Discard();
54 static void Exit();
55
57 void Build(Andromenda::Surface &surface) override;
58
60 void Draw() override {}
61
63 void OnSurfaceCallback(const String &id) override;
64 };
65} // namespace Game
The renderer of component registry.
Definition Surface.h:28
Text component that can't be selectable.
Definition TextComponent.h:13
Represents a screen where user have to make a choice from declared entries.
Definition Screen.h:93
void OnSurfaceCallback(const String &id) override
Event called when any component sends callback.
Definition WinScreen.cpp:129
void Build(Andromenda::Surface &surface) override
Event called when this screen is being opened.
Definition WinScreen.cpp:113
void Draw() override
Event called when screen is getting rerendered and this screen is currently rendered screen.
Definition WinScreen.h:60
Represents a mutable sequence of characters, providing various member functions for string manipulati...
Definition String.h:16
std::function< String()> Supplier
Function used to retrieve text that should be set in text component.
Definition WinScreen.h:31
String Id
Unique identifier used to register this entry's component.
Definition WinScreen.h:25
Andromenda::TextComponent * Text
Component associated with this entry.
Definition WinScreen.h:19
Represents a two component vector. Components are 32-bit and they are signed.
Definition Int2.h:11