-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboard.h
63 lines (59 loc) · 1.49 KB
/
board.h
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
//
// Created by funny on 4/16/2023.
//
#ifndef OPTIMIZEDMINESWEEPER_BOARD_H
#define OPTIMIZEDMINESWEEPER_BOARD_H
#include "textures.h"
#include "cell.h"
#include "button.h"
#include "leaderboard.h"
class board {
int WIDTH;
int HEIGHT;
int boardwidth;
int boardheight;
int bombcount;
int flagcounter;
std::string playername;
leaderboard* l;
textures* texturemanager;
std::vector<cell*> cellvect;
std::vector<button*> buttonvect;
std::vector<sf::Sprite> bombdigits;
std::vector<sf::Sprite> clockdigits;
sf::Sprite negative;
bool firstclick = true;
bool paused = false;
bool gameover = false;
bool debug = false;
bool displaynegative = false;
float savedtime = 0;
std::string time = "0000";
public:
bool isgameover();
board(textures* ptr);
std::string welcomewindow();
void setcellvects();
void printcellvects();
void setbombs(int index);
void setnumbers();
void printboard();
void updatesprites(sf::RenderWindow &window);
int getWIDTH();
int getHEIGHT();
bool leftclick(int i);
int getboardwidth();
int rightclick(int i);
void createbuttons();
void updatebuttons(sf::RenderWindow &window);
std::string buttonclick(sf::Vector2f pos);
void restart();
bool gamewon();
void pause();
void updateclock(sf::Time t);
void savetime(float t);
void doleaderboard();
void setname(std::string n);
void clearall();
};
#endif //OPTIMIZEDMINESWEEPER_BOARD_H