|
stmm-games-doc
0.32.0
|
Event that scrolls the board. More...

Classes | |
| struct | Init |
| struct | LocalInit |
| struct | NewRowCheckRemover |
Public Member Functions | |
| ScrollerEvent (Init &&oInit) noexcept | |
| Constructor. More... | |
| void | trigger (int32_t nMsg, int32_t nValue, Event *p0TriggeringEvent) noexcept override |
| The trigger function. More... | |
| const Tile & | boardGetTile (int32_t nX, int32_t nY) const noexcept override |
| Extended board tile getter. More... | |
| const TileAnimator * | boardGetTileAnimator (int32_t nX, int32_t nY, int32_t nIdxTileAni) const noexcept override |
| Extended board tile animator getter. More... | |
Public Member Functions inherited from stmg::Event | |
| virtual | ~Event () noexcept=default |
| virtual void | addMsgFilter (int32_t nInFromMsg, int32_t nInToMsg, int32_t nInFromValue, int32_t nInToValue, bool bOutMsgDefined, int32_t nOutMsg, MSG_FILTER_VALUE_OP eOutValueOperator, int32_t nOutValueOperand, int32_t nOutValueAdd) noexcept |
| Add a message filter. More... | |
| virtual void | addListener (int32_t nGroupId, Event *p0ListenerEvent, int32_t nMsg) noexcept |
| Adds a listener to the event. More... | |
| bool | isActive () const noexcept |
| Tells whether the event is active. More... | |
| int32_t | getTriggerTime () const noexcept |
| The triggering time. More... | |
| int32_t | getPriority () const noexcept |
| The priority. More... | |
| int32_t | getDebugTag () const noexcept |
| The debug tag. More... | |
Public Member Functions inherited from stmg::ExtendedBoard | |
| virtual | ~ExtendedBoard () noexcept=default |
Protected Member Functions | |
| void | reInit (Init &&oInit) noexcept |
| Reinitialization. More... | |
Protected Member Functions inherited from stmg::Event | |
| Event (Init &&oInit) noexcept | |
| Constructor. More... | |
| void | reInit (Init &&oInit) noexcept |
| Reinitialization. More... | |
| virtual void | informListeners (int32_t nGroupId, int32_t nValue) noexcept |
| Calls the trigger function of a group of listeners. More... | |
| const Level & | level () const noexcept |
| The level this event belongs to. More... | |
| Level & | level () noexcept |
| The level this event belongs to. More... | |
Event that scrolls the board.
The scrolling is done by moving the Show area (see Level::showGet()) fractions of a tile (see LocalInit::m_nSlices) over the board. When the next tile is reached a new row is inserted at the bottom of the board.
How a new row is generated can be controlled by input messages.
If new rows are generated randomly, it is possible to discard a row if certain tiles appear in it by setting an inhibitor, which can be activated or deactivated with input messages.
It is also possible to try to minimize free tile removals (the meaning of which is implementation specific) when new rows are added.
This class can currently only scroll down (new rows appear at the bottom of the board).
| anonymous enum |
| Enumerator | |
|---|---|
| MESSAGE_PUSH_ROW | Beware! currently pushed rows are not counted (don't influence LocalInit::m_nRepeat). |
| MESSAGE_PAUSE_TICKS | Number of game ticks to pause (passed through nValue). |
| MESSAGE_PAUSE_MILLISEC | Number of milliseconds to pause (passed through nValue). |
| MESSAGE_SET_SLICES | Change nr of slices (passed through nValue). |
| MESSAGE_SET_NEW_ROW_GEN | nValue is index LocalInit::m_aNewRowTileGens. If negative sets to 0. If bigger than vector size sets last. |
| MESSAGE_NEXT_NEW_ROW_GEN | Switches to next row generator. If last stays on last. |
| MESSAGE_PREV_NEW_ROW_GEN | Switches to previous row generator. If first stays on first. |
| MESSAGE_INHIBIT_START_INDEX_BASE | Starts applying an inhibitor to new rows. The inhibitor index into Init::m_aInhibitors is determined by subtracting MESSAGE_INHIBIT_START_INDEX_BASE from the message number. There can be at most 100 inhibitors. |
| MESSAGE_INHIBIT_STOP_INDEX_BASE | Stops applying an ibhibitor to new rows. Like MESSAGE_INHIBIT_START_INDEX_BASE. |
| anonymous enum |
|
explicitnoexcept |
Constructor.
| oInit | The initialization data. |
|
overridevirtualnoexcept |
Extended board tile getter.
| nX | The x. Can e outside the level's board. |
| nY | The y. Can e outside the level's board. |
Implements stmg::ExtendedBoard.
|
overridevirtualnoexcept |
Extended board tile animator getter.
| nX | The x. Can e outside the level's board. |
| nY | The y. Can e outside the level's board. |
| nIdxTileAni | The tile animation. Must be >= 0 and < Level::getNrTileAniAttrs(). |
Implements stmg::ExtendedBoard.
|
protectednoexcept |
Reinitialization.
| oInit | The initialization data. |
|
overridevirtualnoexcept |
The trigger function.
This function provides the functionality of the event and can be called in two ways.
It can be called by an event through informListeners() this event was listening to. Note: events can listen to themselves.
It can also be called by the timer if the event was active.
When this function is called the event has already been deactivated by the level (if it was active in the first place).
When this function is called the filters of this event have already been applied.
| nMsg | The message received. |
| nValue | The value received. |
| p0TriggeringEvent | The triggering event or null if triggered by timer. |
Implements stmg::Event.
1.8.13