Maze Builder Docs 6.3.5
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_incl (int low, int high) noexcept
 Generates a random integer within a specified range.
 
std::vector< int > get_num_ints_incl (int low=0, int high=1) noexcept
 Generates a random vector of integers with an optional 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_incl()

int mazes::randomizer::get_int_incl ( int low,
int high )
noexcept

Generates a random integer within a specified range.

Parameters
lowThe lower bound of the range (inclusive).
highThe upper bound of the range (inclusive).
Returns
A random integer between the specified range [low, high].

◆ get_num_ints_incl()

std::vector< int > mazes::randomizer::get_num_ints_incl ( int low = 0,
int high = 1 )
noexcept

Generates a random vector of integers with an optional range.

Parameters
lowThe lower bound of the range (inclusive).
highThe upper bound of the range (inclusive).
Returns

◆ operator()()

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

Gets a random integer within a specified range.

Parameters
low
high
Returns

◆ 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: