-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEngine.hpp
More file actions
76 lines (55 loc) · 1.14 KB
/
Engine.hpp
File metadata and controls
76 lines (55 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//
// Created by User on 25.06.2023.
//
#ifndef UNTITLED_ENGINE_HPP
#define UNTITLED_ENGINE_HPP
#include "definitions.hpp"
#include "predefined.hpp"
#include "SortAlgo.hpp"
enum Sorting_Algo {
Bubble,
Selection_Sort,
Insertion_Sort,
Merge_Sort,
Quick_Sort,
Heap_Sort,
Radix_Sort,
Bucket_Sort,
Shell_Sort,
Bingo_Sort,
Comb_Sort,
Pigeonhole_Sort,
Cycle_Sort,
};
class SortAlgo;
class Engine {
private:
sf::RenderWindow window;
std::vector<int> data;
private:
//RANDOM NUMBER GENERATOR
std::mt19937 rng;
int min_value;
int max_value;
std::uniform_int_distribution<int> dist;
private:
//SOUNDS
sf::Sound tickSound;
sf::SoundBuffer tick_sound_buffer;
private:
//std::unique_ptr<SortAlgo> sortAlgo;
SortAlgo * sortAlgo;
private:
void initArray();
void initSounds();
void initRandomEngine();
public:
void startSort(Sorting_Algo sortingAlgo);
void reShuffle(std::vector<int> &array);
public:
Engine();
~Engine();
void run();
static void updatePollEvent(sf::RenderWindow &renderWindow);
};
#endif //UNTITLED_ENGINE_HPP