-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCells_and_grid.cpp
More file actions
48 lines (38 loc) · 839 Bytes
/
Cells_and_grid.cpp
File metadata and controls
48 lines (38 loc) · 839 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
41
42
43
44
45
46
47
48
//
// Created by Lorena Kovačić on 13.05.2023..
//
#include "Cells_and_grid.h"
#include <iostream>
Cells_and_grid::Cells_and_grid() {
std::cout << "Random 1/0 :";
bool f;
std::cin >> f;
if (f)
for (int i = 0; i < nCell; i++)
grid[i] = (double(rand()) / RAND_MAX < 0.1) ? 1 : 0;
}
//geteri
float Cells_and_grid::get_cellSize() {
return cellSize;
}
int Cells_and_grid::get_gWidth() {
return gWidth;
}
int Cells_and_grid::get_gHeight() {
return gHeight;
}
int Cells_and_grid::get_nCell() {
return nCell;
}
int *Cells_and_grid::get_grid() {
return grid;
}
int *Cells_and_grid::get_nextGrid() {
return nextGrid;
}
sf::Vector2<float> &Cells_and_grid::get_cells() {
return const_cast<sf::Vector2<float> &>(cells);
}
int Cells_and_grid::get_delay() {
return delay;
}