Snoke
ball.h
Go to the documentation of this file.
1 
11 #ifndef BALL_H
12 #define BALL_H
13 #include "../Common/common.h"
14 #include <random>
15 #include <ctime>
16 
21 extern Point gameFieldSize;
22 
23 
33 class Ball
34 {
35  private:
37  std::mt19937 randomEngine;
38  uint32_t seed;
39  public:
40  std::uniform_int_distribution<int> distributionX;
41  std::uniform_int_distribution<int> distributionY;
42  bool init(Point dim);
43  Point getCoords();
44  bool setCoords(Point p);
45  std::mt19937* getRandomEngine();
46 };
47 #endif
Describes the Ball entity of the game.
Definition: ball.h:33
std::mt19937 * getRandomEngine()
Definition: ball.cpp:58
Point getCoords()
Get the ball coords without giving the direct access.
Definition: ball.cpp:37
bool init(Point dim)
Initialization.
Definition: ball.cpp:18
std::mt19937 randomEngine
Definition: ball.h:37
Point position
Definition: ball.h:36
uint32_t seed
Definition: ball.h:38
std::uniform_int_distribution< int > distributionX
Definition: ball.h:40
Point gameFieldSize
Definition: game.cpp:17
bool setCoords(Point p)
Sets coordinates of the ball to given if they are correct.
Definition: ball.cpp:47
std::uniform_int_distribution< int > distributionY
Definition: ball.h:41
Coordinates and style of the cell in console window.
Definition: common.h:52