-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoard.h
More file actions
40 lines (31 loc) · 1.01 KB
/
Copy pathBoard.h
File metadata and controls
40 lines (31 loc) · 1.01 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
#ifndef SAPPER_BOARD_H
#define SAPPER_BOARD_H
#include <random>
#include <algorithm>
#include <vector>
#include "Field.h"
#include "SFML/Graphics.hpp"
class Board {
protected:
std::vector<std::vector<Field>> bord;
int x{}, y{}, mines{};
void next(int x, int y);
std::vector<std::vector<Field>> generateMine(int mines, int startX, int startY);
void fieldNextType(int x, int y);
public:
std::vector<std::vector<Field>> generateBoard(int x, int y);
void draw(sf::RenderWindow& window, bool end, int pressed_x=-1, int pressed_y=-1);
std::vector<std::vector<Field>>& getBord();
virtual void flag(int x, int y);
int getX() const;
bool checkIFWin();
int getY() const;
int getCount() const;
Board();
Board(int x, int y, int count);
~Board();
Board& operator=(const Board& bord_);
friend std::ostream& operator<<(std::ostream& stream, const Board& pattern);
friend std::istream& operator>>(std::istream& stream, Board& pattern);
};
#endif //SAPPER_BOARD_H