stmm-games-doc  0.32.0
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
stmg::Level::Init Struct Reference

Public Member Functions

int32_t getBoardIndex (NPoint oXY) const noexcept
 Gets the index within m_aBoard from coords. More...
 

Static Public Member Functions

static int32_t getBoardIndex (NPoint oXY, NSize oBoardSize) noexcept
 

Public Attributes

int32_t m_nBoardW = 0
 The board width. More...
 
int32_t m_nBoardH = 0
 The board height. More...
 
std::vector< Tilem_aBoard
 The initial board tiles. More...
 
int32_t m_nShowW = 0
 The show width. More...
 
int32_t m_nShowH = 0
 The show height. More...
 
int32_t m_nShowInitX = 0
 The show initial x position within the board. More...
 
int32_t m_nShowInitY = 0
 The show initial y position within the board. More...
 
int32_t m_nSubshowW = 0
 The player subshow width. More...
 
int32_t m_nSubshowH = 0
 The player subshow height. More...
 
int32_t m_nInitialFallEachTicks = 8
 The initial fall rate of level blocks. More...
 

Member Function Documentation

◆ getBoardIndex() [1/2]

int32_t stmg::Level::Init::getBoardIndex ( NPoint  oXY) const
inlinenoexcept

Gets the index within m_aBoard from coords.

The correct values for m_nBoardW and m_nBoardH must be set before calling this function.

Parameters
oXYThe coords.
Returns
The index.

◆ getBoardIndex() [2/2]

static int32_t stmg::Level::Init::getBoardIndex ( NPoint  oXY,
NSize  oBoardSize 
)
inlinestaticnoexcept

Member Data Documentation

◆ m_aBoard

std::vector< Tile > stmg::Level::Init::m_aBoard

The initial board tiles.

m_aBoard[nX + nY * nBoardW]: nX from 0 to nBoardW-1, nY from 0 to nBoardH-1.

◆ m_nBoardH

int32_t stmg::Level::Init::m_nBoardH = 0

The board height.

Must be > 0.

◆ m_nBoardW

int32_t stmg::Level::Init::m_nBoardW = 0

The board width.

Must be > 0.

◆ m_nInitialFallEachTicks

int32_t stmg::Level::Init::m_nInitialFallEachTicks = 8

The initial fall rate of level blocks.

Default is 8.

◆ m_nShowH

int32_t stmg::Level::Init::m_nShowH = 0

The show height.

Must be > 0 and <= m_nBoardH.

◆ m_nShowInitX

int32_t stmg::Level::Init::m_nShowInitX = 0

The show initial x position within the board.

Must be >= 0 and <= m_nBoardW - m_nShowW.

◆ m_nShowInitY

int32_t stmg::Level::Init::m_nShowInitY = 0

The show initial y position within the board.

Must be >= 0 and <= m_nBoardH - m_nShowH.

◆ m_nShowW

int32_t stmg::Level::Init::m_nShowW = 0

The show width.

Must be > 0 and <= m_nBoardW.

◆ m_nSubshowH

int32_t stmg::Level::Init::m_nSubshowH = 0

The player subshow height.

If <=0 no subshow mode, otherwise must be <= m_nShowH.

◆ m_nSubshowW

int32_t stmg::Level::Init::m_nSubshowW = 0

The player subshow width.

If <=0 no subshow mode, otherwise must be <= m_nShowW.