stmm-games-doc  0.32.0
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
stmg::TileAnimator Class Referenceabstract

Interface used to animate tiles of board and level blocks. More...

Public Member Functions

virtual ~TileAnimator () noexcept=default
 

Static Public Attributes

static constexpr double s_fInactiveElapsed = -1.0
 Unary elapsed meaning inactive tile animation. More...
 

Protected Member Functions

virtual double getElapsed01 (int32_t nHash, int32_t nX, int32_t nY, int32_t nAni, int32_t nViewTick, int32_t nTotTicks) const noexcept=0
 Get unary elapsed of a board tile animation at a view tick. More...
 
virtual double getElapsed01 (int32_t nHash, const LevelBlock &oLevelBlock, int32_t nBrickIdx, int32_t nAni, int32_t nViewTick, int32_t nTotTicks) const noexcept=0
 Get unary elapsed of a block brick tile animation at a view tick. More...
 

Detailed Description

Interface used to animate tiles of board and level blocks.

Constructor & Destructor Documentation

◆ ~TileAnimator()

virtual stmg::TileAnimator::~TileAnimator ( )
virtualdefaultnoexcept

Member Function Documentation

◆ getElapsed01() [1/2]

virtual double stmg::TileAnimator::getElapsed01 ( int32_t  nHash,
int32_t  nX,
int32_t  nY,
int32_t  nAni,
int32_t  nViewTick,
int32_t  nTotTicks 
) const
protectedpure virtualnoexcept

Get unary elapsed of a board tile animation at a view tick.

Parameters
nHashThe value passed to Level::boardSetTileAnimator().
nXThe x cell on the board.
nYThe y cell on the board.
nAniIndex into Named::tileAnis().
nViewTickThe view tick. Must be >= 0 and < nTotTicks.
nTotTicksThe total number of view ticks.
Returns
The elapsed (0.0 to 1.0) or s_fInactiveElapsed if inactive.

◆ getElapsed01() [2/2]

virtual double stmg::TileAnimator::getElapsed01 ( int32_t  nHash,
const LevelBlock oLevelBlock,
int32_t  nBrickIdx,
int32_t  nAni,
int32_t  nViewTick,
int32_t  nTotTicks 
) const
protectedpure virtualnoexcept

Get unary elapsed of a block brick tile animation at a view tick.

Parameters
nHashThe value passed to LevelBlock::blockSetTileAnimator().
oLevelBlockThe level block.
nBrickIdxThe brick number. Must be positive.
nAniIndex into Named::tileAnis().
nViewTickThe view tick. Must be >= 0 and < nTotTicks.
nTotTicksThe total number of view ticks.
Returns
The elapsed (0.0 to 1.0) or s_fInactiveElapsed if inactive.

Member Data Documentation

◆ s_fInactiveElapsed

constexpr double stmg::TileAnimator::s_fInactiveElapsed = -1.0
static

Unary elapsed meaning inactive tile animation.