stmm-games-doc  0.32.0
Public Member Functions | List of all members
stmg::StdRandomSource Class Reference
Inheritance diagram for stmg::StdRandomSource:
Inheritance graph
[legend]

Public Member Functions

 StdRandomSource () noexcept
 
int32_t random (int32_t nFrom, int32_t nTo) noexcept override
 Generate a random integer for an interval. More...
 
- Public Member Functions inherited from stmg::RandomSource
virtual ~RandomSource () noexcept=default
 

Constructor & Destructor Documentation

◆ StdRandomSource()

stmg::StdRandomSource::StdRandomSource ( )
noexcept

Member Function Documentation

◆ random()

int32_t stmg::StdRandomSource::random ( int32_t  nFrom,
int32_t  nTo 
)
overridevirtualnoexcept

Generate a random integer for an interval.

Parameters
nFromThe start of the interval.
nToThe end of the interval. Must be >= nFrom.
Returns
The random number. Is >= nFrom and <= nTo.

Implements stmg::RandomSource.