Maze Builder Docs 7.5.6
Loading...
Searching...
No Matches
randomizer.h
Go to the documentation of this file.
1#ifndef RANDOMIZER_H
2#define RANDOMIZER_H
3
4#include <vector>
5#include <memory>
6
8namespace mazes
9{
10
12
17 {
18 public:
21
24
27 randomizer(const randomizer &other);
28
33
36 randomizer(randomizer &&other) noexcept;
37
41 randomizer &operator=(randomizer &&other) noexcept;
42
47 int get_int(int low = 0, int high = 1) noexcept;
48
54 std::vector<int> get_vector_ints(int low = 0, int high = 1, int count = 1) noexcept;
55
58 void seed(unsigned long long seed = 0) noexcept;
59
64 int operator()(int low, int high) noexcept
65 {
66
67 return get_int(low, high);
68 }
69
70 private:
71 class randomizer_impl;
72
73 std::unique_ptr<randomizer_impl> m_impl;
74 };
75
76}
77#endif // RANDOMIZER_H
Provides random-number generating capabilities.
Definition randomizer.h:17
void seed(unsigned long long seed=0) noexcept
Seeds the random number generator with the given seed value.
int get_int(int low=0, int high=1) noexcept
Generates a random integer within a specified range.
~randomizer()
Destructor.
randomizer(randomizer &&other) noexcept
Move constructor.
randomizer & operator=(randomizer &&other) noexcept
Move assignment operator.
randomizer()
Default constructor.
randomizer & operator=(const randomizer &other)
Copy assignment operator.
std::vector< int > get_vector_ints(int low=0, int high=1, int count=1) noexcept
Generates a shuffled vector of all integers in the specified range.
randomizer(const randomizer &other)
Copy constructor.
Namespace for the maze builder.
Definition algo_interface.h:6