stmm-games-doc  0.32.0
Classes | Public Member Functions | List of all members
stmg::NewRows Class Reference

Classes

struct  Distr
 
struct  DistrFixed
 
struct  DistrRandPosSingle
 
struct  DistrRandPosTiles
 
struct  DistrRandSingle
 
struct  DistrRandTiles
 
struct  Init
 
struct  NewRowGen
 

Public Member Functions

 NewRows (RandomSource &oRandomSource, Init &&oInit) noexcept
 Constructor. More...
 
 NewRows (NewRows &&oSource) noexcept=default
 
int32_t getTotNewRowGens () const noexcept
 The number of new row generators. More...
 
int32_t getTotRandomTileGens () const noexcept
 The number of random tile generators. More...
 
int32_t getMinSize () const noexcept
 The minimum size of the row. More...
 
void createNewRow (int32_t nNewRowGenIdx, TileBuffer &oTileBuffer, int32_t nRow) noexcept
 Create a random row. More...
 

Constructor & Destructor Documentation

◆ NewRows() [1/2]

stmg::NewRows::NewRows ( RandomSource oRandomSource,
Init &&  oInit 
)
noexcept

Constructor.

Parameters
oRandomSourceThe random source. Must persist during he active lifetime of this instance.
oInitThe initialization data.

◆ NewRows() [2/2]

stmg::NewRows::NewRows ( NewRows &&  oSource)
defaultnoexcept

Member Function Documentation

◆ createNewRow()

void stmg::NewRows::createNewRow ( int32_t  nNewRowGenIdx,
TileBuffer oTileBuffer,
int32_t  nRow 
)
noexcept

Create a random row.

If the tile buffer has non empty tiles when this function is called, they are not overwritten.

Parameters
nNewRowGenIdxThe index into Init::m_aNewRowGens. Must be >= 0 and < getTotNewRowGens().
oTileBufferThe tile buffer to fill. It's width must be >= getMinSize().
nRowThe row to fill in oTileBuffer. Must be >= 0 and < oTileBuffer.getH().

◆ getMinSize()

int32_t stmg::NewRows::getMinSize ( ) const
noexcept

The minimum size of the row.

This is the maximum of the size of all Distr objects. See createNewRow.

Returns
The minimum size.

◆ getTotNewRowGens()

int32_t stmg::NewRows::getTotNewRowGens ( ) const
noexcept

The number of new row generators.

Returns
The number of new row generators.

◆ getTotRandomTileGens()

int32_t stmg::NewRows::getTotRandomTileGens ( ) const
noexcept

The number of random tile generators.

Returns
The number of random tile generators.