This commit is contained in:
2026-03-05 11:34:43 +03:00
parent 5a942f935f
commit e6bdeaef50
7 changed files with 242 additions and 3 deletions
+6
View File
@@ -1,6 +1,7 @@
#pragma once
#include <SFML/Graphics.hpp>
#include "Sorter.hpp"
#include "SortHistory.hpp"
#include <string>
class UI {
@@ -10,6 +11,10 @@ public:
void update(const Sorter& sorter, bool isPlaying, bool isFinished, int stepsPerFrame, const Array& array);
void draw(sf::RenderWindow& window);
void drawInfoOverlay(sf::RenderWindow& window);
void drawHistoryOverlay(sf::RenderWindow& window, const SortHistory& history);
void toggleHistory();
void closeHistory();
bool isHistoryOpen() const;
private:
sf::Font font_;
@@ -24,4 +29,5 @@ private:
sf::RectangleShape leftBackground_;
sf::RectangleShape rightBackground_;
bool fontLoaded_;
bool historyOpen_;
};