This commit is contained in:
2026-03-02 15:22:47 +03:00
parent c0ab7e843c
commit 7cdd2068be
6 changed files with 146 additions and 16 deletions
+17
View File
@@ -0,0 +1,17 @@
#pragma once
#include <SFML/Graphics.hpp>
#include "Array.hpp"
class App {
public:
App();
void run();
private:
void handleEvents();
void update(float dt);
void render();
sf::RenderWindow window_;
Array array_;
};
+22
View File
@@ -0,0 +1,22 @@
#pragma once
#include <vector>
class Array {
public:
enum class State { NORMAL, COMPARE, SWAP, SORTED };
Array(int size);
void shuffle();
int getSize() const;
float getValue(int index) const;
State getState(int index) const;
void setValue(int index, float value);
void setState(int index, State state);
void resetStates();
private:
std::vector<float> data_;
std::vector<State> states_;
};