-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathField.h
More file actions
41 lines (33 loc) · 967 Bytes
/
Field.h
File metadata and controls
41 lines (33 loc) · 967 Bytes
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
#include <SFML/Graphics.hpp>
#include <iostream>
#include <numeric>
#include <vector>
#include <random>
#include <thread>
#include <chrono>
struct Column {
float value{};
sf::RectangleShape cell;
};
class Field {
public:
explicit Field(float colNumber,
float gapWidth = 0.05,
float gapEdgesWidth = 0.02,
float resolutionWidth = 1280,
float resolutionHeight = 720);
void drawAllColumns(sf::RenderWindow& window);
void setColumnPosition(Column& column);
void randomizeColumns();
std::vector<Column>& getColumns();
Column& operator [] (int index);
private:
std::vector<Column> columns;
float numberOfColumns;
float resolutionWithoutEdges;
float widthOfCell;
float columnsGap;
float edgesGap;
float resolutionWidth;
float resolutionHeight;
};