Snoke
Ball Class Reference

Describes the Ball entity of the game. More...

#include <ball.h>

Collaboration diagram for Ball:

Public Member Functions

bool init (Point dim)
 Initialization. More...
 
Point getCoords ()
 Get the ball coords without giving the direct access. More...
 
bool setCoords (Point p)
 Sets coordinates of the ball to given if they are correct. More...
 
std::mt19937 * getRandomEngine ()
 

Public Attributes

std::uniform_int_distribution< int > distributionX
 
std::uniform_int_distribution< int > distributionY
 

Private Attributes

Point position
 
std::mt19937 randomEngine
 
uint32_t seed
 

Detailed Description

Describes the Ball entity of the game.

Parameters
position- Coordinates(x, y) of a Ball in the Console window
randomEngine- variable, responible for the 'random' during the game
seed_val- value 'feeded' to the 'random' generator
distributionX- an equally likely int distribution for x coordinate of a Ball
distributionY- an equally likely int distribution for y coordinate of a Ball

Definition at line 33 of file ball.h.

Member Function Documentation

Point Ball::getCoords ( )

Get the ball coords without giving the direct access.

Definition at line 37 of file ball.cpp.

Here is the caller graph for this function:

std::mt19937 * Ball::getRandomEngine ( )

Definition at line 58 of file ball.cpp.

Here is the caller graph for this function:

bool Ball::init ( Point  fieldSize)

Initialization.

Parameters
fieldSize- the size of the game field(x, y)
Returns
- mark of successful initialization

Definition at line 18 of file ball.cpp.

Here is the caller graph for this function:

bool Ball::setCoords ( Point  p)

Sets coordinates of the ball to given if they are correct.

Parameters
p- point to copy coords from
Returns
- mark os succesful copy

Definition at line 47 of file ball.cpp.

Here is the caller graph for this function:

Member Data Documentation

std::uniform_int_distribution<int> Ball::distributionX

Definition at line 40 of file ball.h.

std::uniform_int_distribution<int> Ball::distributionY

Definition at line 41 of file ball.h.

Point Ball::position
private

Definition at line 36 of file ball.h.

std::mt19937 Ball::randomEngine
private

Definition at line 37 of file ball.h.

uint32_t Ball::seed
private

Definition at line 38 of file ball.h.


The documentation for this class was generated from the following files: