Maze Builder Docs 7.5.6
Loading...
Searching...
No Matches
mazes::randomizer Class Reference

Provides random-number generating capabilities. More...

#include <randomizer.h>

Public Member Functions

 randomizer ()
 Default constructor.
 
 ~randomizer ()
 Destructor.
 
 randomizer (const randomizer &other)
 Copy constructor.
 
randomizeroperator= (const randomizer &other)
 Copy assignment operator.
 
 randomizer (randomizer &&other) noexcept
 Move constructor.
 
randomizeroperator= (randomizer &&other) noexcept
 Move assignment operator.
 
int get_int (int low=0, int high=1) noexcept
 Generates a random integer within a specified range.
 
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.
 
void seed (unsigned long long seed=0) noexcept
 Seeds the random number generator with the given seed value.
 
int operator() (int low, int high) noexcept
 Gets a random integer within a specified range.
 

Detailed Description

Provides random-number generating capabilities.

This class provides methods for generating random numbers

Constructor & Destructor Documentation

◆ randomizer() [1/2]

mazes::randomizer::randomizer ( const randomizer & other)

Copy constructor.

Parameters
otherThe randomizer object to copy from

◆ randomizer() [2/2]

mazes::randomizer::randomizer ( randomizer && other)
noexcept

Move constructor.

Parameters
otherThe randomizer object to move from

Member Function Documentation

◆ get_int()

int mazes::randomizer::get_int ( int low = 0,
int high = 1 )
noexcept

Generates a random integer within a specified range.

Parameters
lowThe lower bound of the integer (inclusive).
highThe 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 )
noexcept

Generates a shuffled vector of all integers in the specified range.

Parameters
lowThe lower bound of the integer(s) (inclusive).
highThe upper bound of the integer(s) (inclusive).
countThe number of random integers to generate
Returns
A vector containing all integers in [low, high] in random order

◆ operator()()

int mazes::randomizer::operator() ( int low,
int high )
inlinenoexcept

Gets a random integer within a specified range.

Parameters
lowThe lower bound of the integer (inclusive).
highThe upper bound of the integer (inclusive).
Returns
A random integer within the specified range.

◆ operator=() [1/2]

randomizer & mazes::randomizer::operator= ( const randomizer & other)

Copy assignment operator.

Parameters
otherThe randomizer object to copy from
Returns
Reference to the current object

◆ operator=() [2/2]

randomizer & mazes::randomizer::operator= ( randomizer && other)
noexcept

Move assignment operator.

Parameters
otherThe randomizer object to move from
Returns
Reference to the current object

◆ seed()

void mazes::randomizer::seed ( unsigned long long seed = 0)
noexcept

Seeds the random number generator with the given seed value.

Parameters
seedThe seed value to initialize the random number generator.

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