Meteory są w tym samym stanie co w poprzednim commit, tylko, że teraz są zdefiniowane w osobnej klasie "Plansza"
This commit is contained in:
20
headers/RandomNumberGenerator.h
Normal file
20
headers/RandomNumberGenerator.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef LOTOSTATEK_RANDOMNUMBERGENERATOR_H
|
||||
#define LOTOSTATEK_RANDOMNUMBERGENERATOR_H
|
||||
|
||||
#include <random>
|
||||
|
||||
class RandomNumberGenerator {
|
||||
private:
|
||||
std::random_device rd;
|
||||
std::mt19937 gen;
|
||||
std::uniform_int_distribution<> dis;
|
||||
|
||||
public:
|
||||
RandomNumberGenerator() : gen(rd()), dis(0, 599) {}
|
||||
|
||||
int getRandomNumber() {
|
||||
return dis(gen);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //LOTOSTATEK_RANDOMNUMBERGENERATOR_H
|
||||
Reference in New Issue
Block a user