 |
Minesweeper2
V1.1.1
Game in C++ by Górka Mateusz
|
Go to the documentation of this file.
38 void set(
unsigned int w,
unsigned int h,
unsigned int m );
79 {
return this->
size.
x; }
86 {
return this->
size.
y; }
94 {
return this->
board != NULL; }
103 {
return ( pos.
x >= 0 && pos.
x <
size.
x ) && ( pos.
y >= 0 && pos.
y <
size.
y ); }
123 {
return board[ vec.
x ][ vec.
y ]; }
133 {
return board[ vec.
x ][ vec.
y ]; }
void flagAll()
Set flag on the all of mines fields.
Definition: Board.cpp:316
2 dimension vector
Definition: Vector2D.hpp:9
void alloc()
Create a array of board.
Definition: Board.cpp:245
Vector2D size
Size od board.
Definition: Board.hpp:13
void set(unsigned int w, unsigned int h, unsigned int m)
Set values on the board.
Definition: Board.cpp:208
void debug() const
Display board on the console to debuging.
Definition: Board.cpp:324
Board()=default
Construct a new Board object (default constructor)
Board of game.
Definition: Board.hpp:11
short int mines_init
Number of mines in beginning of the game.
Definition: Board.hpp:15
void free()
Free memory if board array exist.
Definition: Board.cpp:234
T x
X coordinate of vectior.
Definition: Vector2D.hpp:11
bool created() const
Is array created?
Definition: Board.hpp:93
short int noFlaggedMines() const
Number of no flagged mines on the board.
Definition: Board.hpp:70
int h() const
Height of board.
Definition: Board.hpp:85
static const Vector2D AROUND[8]
Vectors of around coordinates.
Definition: Board.hpp:178
void calcFields()
Calculate values of field after rand mines position.
Definition: Board.cpp:285
bool inside(const Vector2D &pos) const
Is filel inside the board.
Definition: Board.hpp:102
bool uncover(const Vector2D &click)
Uncover the choosen field.
Definition: Board.cpp:23
void randMines(const Vector2D &click)
Rand mines position on the board.
Definition: Board.cpp:259
short int mines
Number of no flagged mines.
Definition: Board.hpp:16
~Board()
Destroy the Board object.
Definition: Board.cpp:18
void restart()
Restart the board.
Definition: Board.cpp:223
int w() const
Width of board.
Definition: Board.hpp:78
Field ** board
Array of fields on the board. Coordinates: Board[ x ][ y ].
Definition: Board.hpp:14
void uncoverAll()
Uncover all fields on the board.
Definition: Board.cpp:308
T y
Y coordinate of vectior.
Definition: Vector2D.hpp:12
short unsigned int covered
Number of covered fields.
Definition: Board.hpp:17
const Field & operator()(const Vector2D &vec) const
Value of field.
Definition: Board.hpp:122
Field of the board.
Definition: Field.hpp:26
bool hint(Vector2D *&pos) const
Find a hint for player with AI.
Definition: Board.cpp:114
bool action(const Vector2D &click)
Do second action on selected field.
Definition: Board.cpp:76