Provides random-number generating capabilities.
More...
#include <randomizer.h>
|
|
| randomizer () |
| | Default constructor.
|
| |
|
| ~randomizer () |
| | Destructor.
|
| |
| | randomizer (const randomizer &other) |
| | Copy constructor.
|
| |
| randomizer & | operator= (const randomizer &other) |
| | Copy assignment operator.
|
| |
| | randomizer (randomizer &&other) noexcept |
| | Move constructor.
|
| |
| randomizer & | operator= (randomizer &&other) noexcept |
| | Move assignment operator.
|
| |
| int | get_int (int low=0, int high=1) const noexcept |
| | Generates a random integer within a specified range.
|
| |
| std::vector< int > | get_vector_ints (int low=0, int high=1, int count=1) const noexcept |
| | Generates a shuffled vector of all integers in the specified range.
|
| |
| float | get_float (float low=0.0f, float high=1.0f) const noexcept |
| | Generates a random float within a specified range.
|
| |
| void | seed (unsigned long long seed=0) const noexcept |
| | Seeds the random number generator with the given seed value.
|
| |
| int | operator() (const int low, const int high) const noexcept |
| | Gets a random integer within a specified range.
|
| |
Provides random-number generating capabilities.
This class provides methods for generating random numbers
◆ randomizer() [1/2]
| mazes::randomizer::randomizer |
( |
const randomizer & | other | ) |
|
Copy constructor.
- Parameters
-
| other | The randomizer object to copy from |
◆ randomizer() [2/2]
| mazes::randomizer::randomizer |
( |
randomizer && | other | ) |
|
|
noexcept |
Move constructor.
- Parameters
-
| other | The randomizer object to move from |
◆ get_float()
| float mazes::randomizer::get_float |
( |
float | low = 0.0f, |
|
|
float | high = 1.0f ) const |
|
nodiscardnoexcept |
Generates a random float within a specified range.
- Parameters
-
| low | The lower bound of the float (inclusive). |
| high | The upper bound of the float (inclusive). |
- Returns
- A random float between the specified range [low, high].
◆ get_int()
| int mazes::randomizer::get_int |
( |
int | low = 0, |
|
|
int | high = 1 ) const |
|
noexcept |
Generates a random integer within a specified range.
- Parameters
-
| low | The lower bound of the integer (inclusive). |
| high | The upper bound of the integer (inclusive). |
- Returns
- A random integer between the specified range [low, high].
◆ get_vector_ints()
| std::vector< int > mazes::randomizer::get_vector_ints |
( |
int | low = 0, |
|
|
int | high = 1, |
|
|
int | count = 1 ) const |
|
nodiscardnoexcept |
Generates a shuffled vector of all integers in the specified range.
- Parameters
-
| low | The lower bound of the integer(s) (inclusive). |
| high | The upper bound of the integer(s) (inclusive). |
| count | The number of random integers to generate |
- Returns
- A vector containing all integers in [low, high] in random order
◆ operator()()
| int mazes::randomizer::operator() |
( |
const int | low, |
|
|
const int | high ) const |
|
inlinenoexcept |
Gets a random integer within a specified range.
- Parameters
-
| low | The lower bound of the integer (inclusive). |
| high | The upper bound of the integer (inclusive). |
- Returns
- A random integer within the specified range.
◆ operator=() [1/2]
Copy assignment operator.
- Parameters
-
| other | The randomizer object to copy from |
- Returns
- Reference to the current object
◆ operator=() [2/2]
Move assignment operator.
- Parameters
-
| other | The randomizer object to move from |
- Returns
- Reference to the current object
◆ seed()
| void mazes::randomizer::seed |
( |
unsigned long long | seed = 0 | ) |
const |
|
noexcept |
Seeds the random number generator with the given seed value.
- Parameters
-
| seed | The seed value to initialize the random number generator. |
The documentation for this class was generated from the following file: