stmm-games-doc  0.32.0
Public Member Functions | List of all members
stmg::LevelShow::Positioner Class Referenceabstract

Interface to position the LevelShow during view ticks. More...

Public Member Functions

virtual ~Positioner () noexcept=default
 
virtual FPoint getPos (int32_t nViewTick, int32_t nTotViewTicks) noexcept=0
 The position in tiles within the context of the LevelShow. More...
 

Detailed Description

Interface to position the LevelShow during view ticks.

Constructor & Destructor Documentation

◆ ~Positioner()

virtual stmg::LevelShow::Positioner::~Positioner ( )
virtualdefaultnoexcept

Member Function Documentation

◆ getPos()

virtual FPoint stmg::LevelShow::Positioner::getPos ( int32_t  nViewTick,
int32_t  nTotViewTicks 
)
pure virtualnoexcept

The position in tiles within the context of the LevelShow.

The implementation can expect the view ticks to happen in order, but except for the first (nViewTick == 0) and the last (nTotViewTicks - 1), view ticks might be skipped.

As all functions called within a view tick, it should do as little as possible. Implementations examples: move "smoothly" from a starting position to a destination or vibrating around the current position.

Parameters
nViewTickThe view tick. Must be >= 0 and < nTotViewTicks.
nTotViewTicksThe number of view ticks in the game interval. Must be >= 1.
Returns
The position in tiles.