mirror of
https://github.com/koloideal/SortLab.git
synced 2026-06-10 10:25:30 +03:00
update
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
#pragma once
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <SFML/Audio.hpp>
|
||||
#include <memory>
|
||||
#include "Array.hpp"
|
||||
#include "Sorter.hpp"
|
||||
#include "UI.hpp"
|
||||
|
||||
class App {
|
||||
public:
|
||||
@@ -11,7 +15,26 @@ private:
|
||||
void handleEvents();
|
||||
void update(float dt);
|
||||
void render();
|
||||
void switchSorter(std::unique_ptr<Sorter> newSorter);
|
||||
void generateBeepSound();
|
||||
void playBeep(float pitch);
|
||||
|
||||
sf::RenderWindow window_;
|
||||
Array array_;
|
||||
std::unique_ptr<Sorter> currentSorter_;
|
||||
UI ui_;
|
||||
bool isPlaying_;
|
||||
float timeSinceLastStep_;
|
||||
float stepDelay_;
|
||||
|
||||
sf::SoundBuffer beepBuffer_;
|
||||
sf::Sound beepSound_;
|
||||
|
||||
bool isSweeping_;
|
||||
int sweepIndex_;
|
||||
float sweepTimer_;
|
||||
float sweepDelay_;
|
||||
|
||||
size_t lastComparisons_;
|
||||
size_t lastSwaps_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user