Pacman Torben Petré
Loading...
Searching...
No Matches
logic::Random Class Reference

#include <Random.h>

Public Member Functions

 Random (Random &other)=delete
void operator= (const Random &)=delete
float getFloat ()
 Function that returns a random float value between 0 and 1.
int getInt (int min, int max)
 Helper function that returns a random value between the given min and max. Including the max.

Static Public Member Functions

static Random & getInstance ()
 Returns an instance of the Random class.

Detailed Description

Singleton wrapper for the Mersenne Twister random number engine.

Constructor & Destructor Documentation

◆ Random()

logic::Random::Random ( Random & other)
delete

Singletons should not be cloneable or assignable.

Member Function Documentation

◆ getFloat()

float Random::getFloat ( )
nodiscard

Function that returns a random float value between 0 and 1.

Returns
Random float between 0 and 1

◆ getInstance()

Random & Random::getInstance ( )
staticnodiscard

Returns an instance of the Random class.

Returns
Random instance

◆ getInt()

int Random::getInt ( int min,
int max )
nodiscard

Helper function that returns a random value between the given min and max. Including the max.

Parameters
min
max
Returns

◆ operator=()

void logic::Random::operator= ( const Random & )
delete

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