|
stmm-games-doc
0.32.0
|
Animation model class. More...

Classes | |
| struct | Init |
Public Types | |
| enum | REFSYS { REFSYS_BOARD = -3, REFSYS_SHOW = -2, REFSYS_INVALID = -1, REFSYS_SUBSHOW = 0 } |
| Reference system extended enumeration. More... | |
Public Member Functions | |
| virtual | ~LevelAnimation () noexcept=default |
| int32_t | getId () const noexcept |
| Returns unique Id of this object. More... | |
| bool | isActive () const noexcept |
| Whether the animation was added to the level (and not removed yet). More... | |
| int32_t | getViewAnimationNameIdx () const noexcept |
| The optional view animation name index. More... | |
| REFSYS | getRefSys () noexcept |
| The reference system of the animation. More... | |
| FPoint | getPos () const noexcept |
| The current position of the animation within its reference system. More... | |
| FSize | getSize () const noexcept |
| The size of the animation. More... | |
| int32_t | getZ () const noexcept |
| The depth of the animation. More... | |
| double | gameInterval () const noexcept |
| The current game interval. More... | |
| double | getDuration () const noexcept |
| The duration in milliseconds. More... | |
| void | moveTo (FPoint oPos) noexcept |
| Sets new position within reference system. More... | |
| void | moveTo (int32_t nZ) noexcept |
| Sets new position within reference system. More... | |
| virtual void | onScrolled (Direction::VALUE eDir) noexcept |
| Called by Level when the animation is scrolled by Level::boardScroll. More... | |
| double | getElapsed (int32_t nViewTick, int32_t nTotViewTicks) const noexcept |
| The time elapsed since the animation was started in milliseconds. More... | |
| bool | isStarted (int32_t nViewTick, int32_t nTotViewTicks) const noexcept |
| Whether the animation has already started. More... | |
| bool | isDone (int32_t nViewTick, int32_t nTotViewTicks) const noexcept |
| Whether the animation has finished. More... | |
| Level & | level () noexcept |
| The level. More... | |
| const Level & | level () const noexcept |
| The level. More... | |
| GameProxy & | game () noexcept |
| The game. More... | |
| const GameProxy & | game () const noexcept |
| The game. More... | |
Static Public Attributes | |
| static const double | s_fDurationUndefined |
| Undefined duration constant. More... | |
| static const double | s_fDurationInfinity |
| Infinite duration constant. More... | |
Protected Member Functions | |
| LevelAnimation (const Init &oInit) noexcept | |
| Constructor. More... | |
| void | reInit (const Init &oInit) noexcept |
| Reinitialization. More... | |
Animation model class.
The animation has a position in tiles that can be changed at runtime, but it hasn't a size or a z position, which has to be defined by subclasses.
Reference system extended enumeration.
In subshow mode animations can also be drawn in the subshow square and only seen by the respective level player.
The reference system for nLevelPlayer is REFSYS_SUBSHOW + nLevelPlayer.
| Enumerator | |
|---|---|
| REFSYS_BOARD | Board. |
| REFSYS_SHOW | Show. |
| REFSYS_INVALID | |
| REFSYS_SUBSHOW | Subshow level player 0. |
|
virtualdefaultnoexcept |
|
explicitprotectednoexcept |
Constructor.
| oInit | The parameters. |
|
inlinenoexcept |
The game.
This function can only be called if the animation is active.
|
inlinenoexcept |
The game.
This function can only be called if the animation is active.
|
noexcept |
The current game interval.
This is a shortcut to level().game().gameInterval().
|
inlinenoexcept |
The duration in milliseconds.
-1.0 if undefined, 0.0 if infinity.
|
noexcept |
The time elapsed since the animation was started in milliseconds.
| nViewTick | The current view tick. |
| nTotViewTicks | The number of view ticks in this game interval. |
|
inlinenoexcept |
Returns unique Id of this object.
|
inlinenoexcept |
The current position of the animation within its reference system.
Although it is usually the top-left corner of the animation rectangle, the position is implementation (subclass) specific. For some animations it might represent the center of the animation rectangle, which is defined by the view (ThemeAnimation).
If the animation is scrolled the level will automatically update the position.
|
inlinenoexcept |
The reference system of the animation.
This value cannot change during the lifetime of the animation.
|
inlinenoexcept |
The size of the animation.
Note that as for the position the view is allowed to use a bigger or smaller area.
Either width, height or both might be undefined (<= 0), in which case it must be calculated by the view.
|
inlinenoexcept |
The optional view animation name index.
This value can be used to select the view that draws this animation model. If not set only the (RTTI) type of the this animation object is taken into account.
|
inlinenoexcept |
The depth of the animation.
Higher z animations are drawn on top of lower z animations.
|
inlinenoexcept |
Whether the animation was added to the level (and not removed yet).
|
noexcept |
Whether the animation has finished.
| nViewTick | The current view tick. |
| nTotViewTicks | The number of view ticks in this game interval. |
|
noexcept |
Whether the animation has already started.
| nViewTick | The current view tick. |
| nTotViewTicks | The number of view ticks in this game interval. |
|
inlinenoexcept |
The level.
This function can only be called if the animation is active.
|
inlinenoexcept |
The level.
This function can only be called if the animation is active.
|
inlinenoexcept |
Sets new position within reference system.
| oPos | The new position. |
|
inlinenoexcept |
Sets new position within reference system.
| nZ | The new z position. |
|
virtualnoexcept |
Called by Level when the animation is scrolled by Level::boardScroll.
Called even if the reference system is REFSYS_SUBSHOW. The LevelAnimation implementation does nothing and therefore must not be called by subclasses.
To be scrolled the animation has to be added with Level::animationAddScrolled() rather than Level::animationAdd().
| eDir | The direction of the scroll. |
|
protectednoexcept |
Reinitialization.
See constructor.
|
static |
Infinite duration constant.
|
static |
Undefined duration constant.
The duration should be determined by the theme.
1.8.13