-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRandom.hpp
60 lines (47 loc) · 1.59 KB
/
Random.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//------------------------------------------------------------------------------
// Random.hpp
//
// Authors: Tutors
//------------------------------------------------------------------------------
#ifndef RANDOM_HPP
#define RANDOM_HPP
#include <random>
#include <vector>
namespace Oop
{
class Card;
//----------------------------------------------------------------------------
// Random class
// creates a random order for the Cards on the pickupstack
class Random final
{
private:
std::mt19937 mersenne_twister_;
//--------------------------------------------------------------------------
// returns an integer suitable to seed the random number generator
//
static unsigned int getSeed();
//--------------------------------------------------------------------------
// Constructor of Random Class is private, only getInstance possible
//
Random();
public:
//--------------------------------------------------------------------------
// singleton pattern returns Instance of Random class
//
static Random& getInstance();
//--------------------------------------------------------------------------
// deleted copy constructor
//
Random(const Random& other) = delete;
//--------------------------------------------------------------------------
// deleted assignment operator
//
Random& operator=(const Random& rhs) = delete;
//--------------------------------------------------------------------------
// shuffles the pickupstack
//
void shufflePickupstack(std::vector<Card*>& pick_up_stack);
};
}
#endif