 |
Minesweeper2
V1.1.1
Game in C++ by Górka Mateusz
|
Go to the documentation of this file.
6 #include "SFML/Graphics.hpp"
11 class Game :
public sf::Drawable {
34 Game(
const int argc,
char* argv[] );
47 void click(
const sf::RenderWindow& window,
const sf::Mouse::Button butt );
96 {
return butt == sf::Mouse::Left ? ! this->
buttRev : this->
buttRev; }
116 void draw( sf::RenderTarget& target, sf::RenderStates states )
const override;
bool changeClock()
Is needed to change clock on the screen? + Change stopwatch value.
Definition: Game.hpp:61
bool firstAction(const sf::Mouse::Button butt) const
Is it first mouse action now?
Definition: Game.hpp:95
short int width() const
Width of game window.
Definition: Game.hpp:122
int time() const
Stopwatch clock.
Definition: Game.hpp:53
~Game()=default
Destroy the Game object (default destructor)
#define GUI_MARGIN_T
GUI top margin.
Definition: Const.hpp:20
Board board
Board of game.
Definition: Game.hpp:13
bool allowHint
Is hint is allowed.
Definition: Game.hpp:23
void click(const sf::RenderWindow &window, const sf::Mouse::Button butt)
Click managment.
Definition: Game.cpp:126
Board of game.
Definition: Board.hpp:11
bool running
Is game running on?
Definition: Game.hpp:17
int lastClickTime
Time of last on the board click (or last hint serching)
Definition: Game.hpp:21
Display display
Care about display a game.
Definition: Game.hpp:14
int h() const
Height of board.
Definition: Board.hpp:85
Game()=delete
Constructor deleted.
static Vector2D position(const sf::Vector2i &pos)
Convert coordinates.
Definition: Game.cpp:174
bool buttRev
Current button mode. 0 - normal, 1 - revers button.
Definition: Game.hpp:16
void update()
Update values on the interface (stopwatch, score)
Definition: Game.cpp:186
void finish()
Finish the game.
Definition: Game.cpp:107
#define FIELD_SIZE
Sizes of field on the board.
Definition: Const.hpp:19
int w() const
Width of board.
Definition: Board.hpp:78
bool isOn() const
Is game on?
Definition: Game.hpp:75
void start()
Start the game.
Definition: Game.cpp:113
int stopwatch
Stopwatch value.
Definition: Game.hpp:20
Interface and game organization.
Definition: Game.hpp:11
sf::Clock clock
Stopwatch clock.
Definition: Game.hpp:19
short int height() const
Height of game window.
Definition: Game.hpp:129
void draw(sf::RenderTarget &target, sf::RenderStates states) const override
Draw method.
Definition: Game.cpp:178
Care about display on the interface.
Definition: Display.hpp:11