|
stmm-games-doc
0.32.0
|
The level is the container for board, events and blocks. More...
Classes | |
| struct | Init |
| class | LevelBlockCreator |
| Factory interface for level blocks. More... | |
Public Member Functions | |
| Level (Game *p0Game, int32_t nLevel, const shared_ptr< AppPreferences > &refPreferences, const Init &oInit) noexcept | |
| Construct level instance. More... | |
| void | addEvent (unique_ptr< Event > refEvent) noexcept |
| Adds an event to the level (deactivated). More... | |
| void | addEvent (const std::string &sId, unique_ptr< Event > refEvent) noexcept |
| Adds an event (identifiable by a string id) to the level (deactivated). More... | |
| bool | hasEvent (Event const *p0Event) const noexcept |
| Tells whether the event was added to the level. More... | |
| Event * | getEventById (const std::string &sId) noexcept |
| Get an event by id. More... | |
| const AppPreferences & | prefs () const noexcept |
| The preferences. More... | |
| GameProxy & | game () noexcept |
| The game proxy. More... | |
| const GameProxy & | game () const noexcept |
| The game proxy. More... | |
| int32_t | getLevel () const noexcept |
| The level identifier within the game. More... | |
| int32_t | getTotLevelPlayers () const noexcept |
| The number of players in the level. More... | |
| int32_t | getTotLevelTeams () const noexcept |
| The number of teams in the level. More... | |
| const std::vector< std::pair< int32_t, int32_t > > & | getActiveHumanPlayers () noexcept |
| The currently active human players. More... | |
| LevelShow & | showGet () noexcept |
| The level show of the level. More... | |
| bool | subshowMode () const noexcept |
| Whether each level player has a subshow. More... | |
| LevelShow & | subshowGet (int32_t nLevelTeam, int32_t nMate) noexcept |
| The subshow of a level player. More... | |
| LevelShow & | subshowGet (int32_t nLevelPlayer) noexcept |
| The subshow of a level player. More... | |
| int32_t | getNrTileAniAttrs () const noexcept |
| The number of tile animations for both brick and board cell tiles. More... | |
| bool | boabloUnfreeze (const Coords &oCoords, LevelBlockCreator &oCreator, LevelBlock::MGMT_TYPE eMgmtType) noexcept |
| Creates a block from the board. More... | |
| bool | blockAdd (LevelBlock *p0LevelBlock, LevelBlock::MGMT_TYPE eMgmtType) noexcept |
| Adds a level block to the level. More... | |
| void | blockCycleControl (int32_t nPlayer) noexcept |
| void | blockCycleControl (int32_t nPlayer, LevelBlock *p0Preferred) noexcept |
| void | blockCycleControl (LevelBlock *p0LevelBlock) noexcept |
| void | blockCycleControl (LevelBlock *p0LevelBlock, LevelBlock *p0Preferred) noexcept |
| Gives the player control of another level block. More... | |
| void | blockSetControllable (LevelBlock *p0LevelBlock, bool bPlayerControllable, int32_t nControllerTeam) noexcept |
| Set the controllability of a level block. More... | |
| bool | blockCanPlaceOnBoard (const LevelBlock &oLevelBlock, bool bStrict) const noexcept |
| Tells whether block can be placed on board. More... | |
| void | boabloOwnerBlockSet (LevelBlock &oLevelBlock) noexcept |
| Sets the owner of the cells occupied by the block's visible bricks of its current shape. More... | |
| void | boabloOwnerBlockClear (LevelBlock &oLevelBlock) noexcept |
| Clears the owner of the cells occupied by the block's visible bricks of its current shape. More... | |
| bool | blockIntersectsArea (const LevelBlock &oLevelBlock, int32_t nX, int32_t nY, int32_t nW, int32_t nH) const noexcept |
| Whether any of the block's visible bricks of its current shape are within a rectangle. More... | |
| bool | blockIntersectsArea (const LevelBlock &oLevelBlock, NRect oArea) const noexcept |
| Whether any of the block's visible bricks of its current shape are within a rectangle. More... | |
| bool | blockMoveIsWithinArea (const LevelBlock &oLevelBlock, int32_t nMoveX, int32_t nMoveY, int32_t nX, int32_t nY, int32_t nW, int32_t nH) const noexcept |
| Whether all of the the block's visible bricks of its current shape are within a rectangle after a move. More... | |
| bool | blockMoveIsWithinArea (const LevelBlock &oLevelBlock, int32_t nMoveX, int32_t nMoveY, NRect oArea) const noexcept |
| Whether all of the the block's visible bricks of its current shape are within a rectangle after a move. More... | |
| void | blocksAddListener (BlocksListener *p0Listener) noexcept |
| Adds a a blocks listener. More... | |
| void | blocksRemoveListener (BlocksListener *p0Listener) noexcept |
| Removes a a blocks listener. More... | |
| void | blocksAddBricksIdListener (BlocksBricksIdListener *p0Listener) noexcept |
| Adds a block's bricks change listener. More... | |
| void | blocksRemoveBricksIdListener (BlocksBricksIdListener *p0Listener) noexcept |
| Removes a block's bricks change listener. More... | |
| void | blocksAddPlayerChangeListener (BlocksPlayerChangeListener *p0Listener) noexcept |
| Adds a block's player change listener. More... | |
| void | blocksRemovePlayerChangeListener (BlocksPlayerChangeListener *p0Listener) noexcept |
| Removes a block's player change listener. More... | |
| LevelBlock * | blocksGet (int32_t nId) noexcept |
| Get the level block by id. More... | |
| std::vector< int32_t > | blocksGetAllIds () noexcept |
| All the ids if the active level blocks. More... | |
| std::vector< LevelBlock * > | blocksGetAll () noexcept |
| All the active level blocks. More... | |
| bool | othersAddListener (Event *p0OthersListener) noexcept |
| Add a listener to events from other levels. More... | |
| bool | othersRemoveListener (Event *p0OthersListener) noexcept |
| Removes a listener to events from other levels. More... | |
| int32_t | boardWidth () const noexcept |
| The width of the board in tiles. More... | |
| int32_t | boardHeight () const noexcept |
| The height of the board in tiles. More... | |
| NSize | boardSize () const noexcept |
| The size of the board in tiles. More... | |
| void | boardSetTile (int32_t nX, int32_t nY, const Tile &oTile) noexcept |
| Sets the tile of a board cell. More... | |
| void | boardSetTile (NPoint oXY, const Tile &oTile) noexcept |
| Sets the tile of a board cell. More... | |
| const Tile & | boardGetTile (int32_t nX, int32_t nY) const noexcept |
| Returns the tile of a board cell. More... | |
| const Tile & | boardGetTile (NPoint oXY) const noexcept |
| Returns the tile of a board cell. More... | |
| void | boardSetOwner (int32_t nX, int32_t nY, LevelBlock *p0LevelBlock) noexcept |
| Sets the level block owner of a board's cell. More... | |
| void | boardSetOwner (NPoint oXY, LevelBlock *p0LevelBlock) noexcept |
| Sets the level block owner of a board's cell. More... | |
| LevelBlock * | boardGetOwner (int32_t nX, int32_t nY) const noexcept |
| Returns the level block owner of a board cell. More... | |
| LevelBlock * | boardGetOwner (NPoint oXY) const noexcept |
| Returns the level block owner of a board cell. More... | |
| double | boardGetTileAniElapsed (int32_t nX, int32_t nY, int32_t nIdxTileAni, int32_t nViewTick=0, int32_t nTotViewTicks=1) const noexcept |
| Get the elapsed unary time of a certain tile animation of a cell. More... | |
| double | boardGetTileAniElapsed (NPoint oXY, int32_t nIdxTileAni, int32_t nViewTick=0, int32_t nTotViewTicks=1) const noexcept |
| Get the elapsed unary time of a certain tile animation of a cell. More... | |
| void | boardSetTileAnimator (int32_t nX, int32_t nY, int32_t nIdxTileAni, TileAnimator *p0TileAnimator, int32_t nHash) noexcept |
| Set the tile animator of a cell for a certain tile animation. More... | |
| void | boardSetTileAnimator (NPoint oXY, int32_t nIdxTileAni, TileAnimator *p0TileAnimator, int32_t nHash) noexcept |
| Set the tile animator of a cell for a certain tile animation. More... | |
| const TileAnimator * | boardGetTileAnimator (int32_t nX, int32_t nY, int32_t nIdxTileAni) const noexcept |
| Returns the TileAnimator for a certain tile animation. More... | |
| const TileAnimator * | boardGetTileAnimator (NPoint oXY, int32_t nIdxTileAni) const noexcept |
| Returns the TileAnimator for a certain tile animation. More... | |
| void | boardScrollAddListener (BoardScrollListener *p0Listener) noexcept |
| Adds a listener to board scrolls. More... | |
| void | boardScrollRemoveListener (BoardScrollListener *p0Listener) noexcept |
| Removes a listener to board scrolls. More... | |
| void | boardAddListener (BoardListener *p0Listener) noexcept |
| Adds a listener to board modifications. More... | |
| void | boardRemoveListener (BoardListener *p0Listener) noexcept |
| Removes a listener to board modifications. More... | |
| void | boardScroll (Direction::VALUE eDir, const shared_ptr< TileRect > &refTiles) noexcept |
| Scrolls the board contents in a certain direction. More... | |
| void | boardInsert (Direction::VALUE eDir, NRect oArea, const shared_ptr< TileRect > &refTiles) noexcept |
| Inserts a row or column in a rectangle area. More... | |
| void | boardModify (const TileCoords &oTileCoords) noexcept |
| Modify the cells of given area. More... | |
| void | boardDestroy (const Coords &oCoords) noexcept |
| Destroy single tiles of the board. More... | |
| const Variable & | variable (int32_t nId, int32_t nLevelTeam, int32_t nMate) const noexcept |
| Get existing variable. More... | |
| Variable & | variable (int32_t nId, int32_t nLevelTeam, int32_t nMate) noexcept |
| Get existing variable. More... | |
| shared_ptr< GameWidget > | widgetsGet (const std::string &sWidgetName, int32_t nLevelTeam, int32_t nMate) noexcept |
| Get a named widget. More... | |
| void | animationAdd (const shared_ptr< LevelAnimation > &refLevelAnimation, LevelAnimation::REFSYS eRefSys, double fDelayMillisec) noexcept |
| Adds a level animation. More... | |
| void | animationAdd (const shared_ptr< LevelAnimation > &refLevelAnimation, LevelAnimation::REFSYS eRefSys) noexcept |
| Shortcut for animationAdd(refLevelAnimation, eRefSys, 0.0). More... | |
| void | animationAddScrolled (const shared_ptr< LevelAnimation > &refLevelAnimation, double fDelayMillisec) noexcept |
| Adds a scrolled level animation. More... | |
| void | animationAddScrolled (const shared_ptr< LevelAnimation > &refLevelAnimation) noexcept |
| Shortcut for animationAddScrolled(refLevelAnimation, 0.0). More... | |
| void | animationRemove (const shared_ptr< LevelAnimation > &refLevelAnimation) noexcept |
| Remove a level animation. More... | |
| void | boardAnimateTiles (NRect oArea) noexcept |
| Tells the view it should animate the tiles of an area. More... | |
| void | boardAnimateTile (NPoint oXY) noexcept |
| Tells the view it should animate a tile. More... | |
| void | activateEvent (Event *p0Event, int32_t nStart) noexcept |
| Activate event. More... | |
| void | deactivateEvent (Event *p0Event) noexcept |
| Deactivate event. More... | |
| void | triggerEvent (Event *p0Event, int32_t nMsg, int32_t nValue, Event *p0TriggeringEvent) noexcept |
| Calls the trigger function of an event. More... | |
| int32_t | getFallEachTicks () noexcept |
| Gets the fall rate of level blocks for this level. More... | |
| void | setFallEachTicks (int32_t nFallEachTicks) noexcept |
| Sets the fall rate of level blocks for this level. More... | |
| double | getInterval () noexcept |
| Get the requested interval for the level. More... | |
| void | setInterval (double fMillisec) noexcept |
| Set the requested game interval for the level. More... | |
| bool | gameStatusPlayerOut (int32_t nLevelTeam, int32_t nMate, bool bForceOtherCompleted, bool bCreateTexts) noexcept |
| Declare player dead. More... | |
| bool | gameStatusCompleted (int32_t nLevelTeam, bool bForceOthersFailed, bool bCreateTexts) noexcept |
| Declare team completed the game. More... | |
| bool | gameStatusFailed (int32_t nLevelTeam, bool bForceOtherCompleted, bool bCreateTexts) noexcept |
| Declare team failed the game. More... | |
| void | gameStatusTechnical (const std::vector< std::string > &aIssue) noexcept |
| Technical game over. More... | |
| Named & | getNamed () noexcept |
| const Named & | getNamed () const noexcept |
| int32_t | gameElapsed () const noexcept |
| The elapsed time since the game start in intervals. More... | |
| void | dump (bool bDumpBoard, bool bDumpLevelBlocks, bool bDumpTileAni, bool bDumpCharNames, bool bDumpColorNames, bool bDumpFontNames) const noexcept |
Protected Member Functions | |
| void | reInit (Game *p0Game, int32_t nLevel, const shared_ptr< AppPreferences > &refPreferences, const Init &oInit) noexcept |
| Reinitializes the level instance. More... | |
| void | gameStart () noexcept |
| Signals the start of the game. More... | |
| std::vector< unique_ptr< Event > > | extractAllEvents () noexcept |
| Extracts all events from the level. More... | |
| void | setLevelView (LevelView *p0View) noexcept |
| Set the level view. More... | |
The level is the container for board, events and blocks.
|
noexcept |
Construct level instance.
| p0Game | The game. Cannot be null. |
| nLevel | The number to identify the level within the game. |
| refPreferences | The preferences. Cannot be null. |
| oInit | Initialization data. |
|
noexcept |
Activate event.
If nStart is smaller than the current game tick (see Game::gameElapsed() function), the event is started in the current game tick. This is a way to trigger an event before events with higher priority.
| p0Event | The event. Cannot be null. |
| nStart | The triggering time in game ticks. Must be >= 0. |
|
noexcept |
Adds an event to the level (deactivated).
| refEvent | The event. Cannot be null. |
|
noexcept |
Adds an event (identifiable by a string id) to the level (deactivated).
| sId | The event id. If empty or name is already present the event is unnamed. |
| refEvent | The event. Cannot be null. |
|
noexcept |
Adds a level animation.
If present this function calls the view's animationCreate.
| refLevelAnimation | The animation. Cannot be null. |
| eRefSys | The reference system. |
| fDelayMillisec | The delay in milliseconds. Must be >= 0. |
|
inlinenoexcept |
Shortcut for animationAdd(refLevelAnimation, eRefSys, 0.0).
|
noexcept |
Adds a scrolled level animation.
If present this function calls the view's animationCreate.
| refLevelAnimation | The animation. Cannot be null. |
| fDelayMillisec | The delay in milliseconds. Must be >= 0. |
|
inlinenoexcept |
Shortcut for animationAddScrolled(refLevelAnimation, 0.0).
|
noexcept |
Remove a level animation.
If the animation (scrolled or not) was already removed this function does nothing.
| refLevelAnimation | The animation. Cannot be null. |
|
noexcept |
Adds a level block to the level.
Whether the block could be added to the level depends on the eMgmtType and the current state of the board.
| p0LevelBlock | The level block. Cannot be null. |
| eMgmtType | How the level block is handled. |
|
noexcept |
Tells whether block can be placed on board.
| oLevelBlock | The level block. |
| bStrict | Whether to ensure that the corresponding board cells are empty. |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
Gives the player control of another level block.
If the level block is not controlled by a player or if there is no other level block the player can control this function does nothing.
If the preferred player is null or not available the next level block is usually the next in a chain of level blocks ordered by their x position.
| p0LevelBlock | The level block the player currently controls. Cannot be null. |
| p0Preferred | The preferred level block the player should control next. Can be null. |
|
noexcept |
Whether any of the block's visible bricks of its current shape are within a rectangle.
| oLevelBlock | The level block. |
| nX | The x of the rectangle (in tiles). |
| nY | The y of the rectangle (in tiles). |
| nW | The width of the rectangle (in tiles). |
| nH | The height of the rectangle (in tiles). |
|
inlinenoexcept |
Whether any of the block's visible bricks of its current shape are within a rectangle.
| oLevelBlock | The level block. |
| oArea | The rectangle (in tiles). |
|
noexcept |
Whether all of the the block's visible bricks of its current shape are within a rectangle after a move.
| oLevelBlock | The level block. |
| nMoveX | The move in the x axis (in tiles). |
| nMoveY | The move in the y axis (in tiles). |
| nX | The x of the rectangle (in tiles). |
| nY | The y of the rectangle (in tiles). |
| nW | The width of the rectangle (in tiles). |
| nH | The height of the rectangle (in tiles). |
|
inlinenoexcept |
Whether all of the the block's visible bricks of its current shape are within a rectangle after a move.
| oLevelBlock | The level block. |
| nMoveX | The move in the x axis (in tiles). |
| nMoveY | The move in the y axis (in tiles). |
| oArea | The rectangle (in tiles). |
|
noexcept |
Adds a block's bricks change listener.
| p0Listener | The listener. Cannot be null. |
|
noexcept |
Adds a a blocks listener.
| p0Listener | The listener. Cannot be null. |
|
noexcept |
Adds a block's player change listener.
| p0Listener | The listener. Cannot be null. |
|
noexcept |
Set the controllability of a level block.
| p0LevelBlock | The level block. Cannot be null. |
| bPlayerControllable | Whether players can control the level block. |
| nControllerTeam | The level team allowed to control the block or -1 if any. |
|
noexcept |
Get the level block by id.
| nId | The id. |
|
noexcept |
All the active level blocks.
This is supposed to be called once and then changes tracked by installing a BlocksListener.
|
noexcept |
All the ids if the active level blocks.
|
noexcept |
Removes a block's bricks change listener.
| p0Listener | The listener. Cannot be null. |
|
noexcept |
Removes a a blocks listener.
| p0Listener | The listener. Cannot be null. |
|
noexcept |
Removes a block's player change listener.
| p0Listener | The listener. Cannot be null. Must exist. |
|
noexcept |
Clears the owner of the cells occupied by the block's visible bricks of its current shape.
If a cell is owned, it has to be owned by oLevelBlock.
| oLevelBlock | The level block. |
|
noexcept |
Sets the owner of the cells occupied by the block's visible bricks of its current shape.
The owner is the block itself. If a cell already has an owner it is overwritten.
| oLevelBlock | The level block. |
|
noexcept |
Creates a block from the board.
The board cells cannot be empty when the block is created. The board cells used to build the block will be empty after the call.
| oCoords | The coords of the cells on the board used to make the block. Cannot be empty. |
| oCreator | The level block creator factory. |
| eMgmtType | The level block type. |
|
noexcept |
Adds a listener to board modifications.
| p0Listener | The listener. Cannot be null. |
|
inlinenoexcept |
Tells the view it should animate a tile.
The tile will be animated during the view ticks following the current game tick by calling the tile animator of the tile if present or just redrawing it.
| oXY | The position to animate. Must be within board. |
|
inlinenoexcept |
Tells the view it should animate the tiles of an area.
See boardAnimateTile(NPoint oXY).
| oArea | The area to animate. |
|
noexcept |
Destroy single tiles of the board.
The tiles are set to empty. Calls BoardListener::boardPreDestroy and BoardListener::boardPostDestroy.
The tile animations and block ownership are left unchanged.
The difference with modifying the tiles to empty tiles is that the view can automatically create explosions.
| oCoords | The coords of the board cells. Must be within the board. |
|
noexcept |
Returns the level block owner of a board cell.
| nX | The x (in tiles). Must be >= 0 and < boardWidth(). |
| nY | The y (in tiles). Must be >= 0 and < boardHeight(). |
|
inlinenoexcept |
Returns the level block owner of a board cell.
| oXY | The position (in tiles). Must be within the board. |
|
noexcept |
Returns the tile of a board cell.
| nX | The x (in tiles). Must be >= 0 and < boardWidth(). |
| nY | The y (in tiles). Must be >= 0 and < boardHeight(). |
Returns the tile of a board cell.
| oXY | The position (in tiles). Must be within the board. |
|
noexcept |
Get the elapsed unary time of a certain tile animation of a cell.
This function calls the tile animator of the cell.
| nX | The x (in tiles). Must be >= 0 and < boardWidth(). |
| nY | The y (in tiles). Must be >= 0 and < boardHeight(). |
| nIdxTileAni | The tile animation. Must be >= 0 and < getNrTileAniAttrs(). |
| nViewTick | The view tick. Must be >= 0 and < nTotTicks. |
| nTotViewTicks | The number of view ticks. Must be >= 1. |
|
inlinenoexcept |
Get the elapsed unary time of a certain tile animation of a cell.
This function calls the tile animator of the cell.
| oXY | The position (in tiles). Must be within the board. |
| nIdxTileAni | The tile animation. Must be >= 0 and < getNrTileAniAttrs(). |
| nViewTick | The view tick. Must be >= 0 and < nTotTicks. |
| nTotViewTicks | The number of view ticks. Must be >= 1. |
|
noexcept |
Returns the TileAnimator for a certain tile animation.
| nX | The x (in tiles). Must be >= 0 and < boardWidth(). |
| nY | The y (in tiles). Must be >= 0 and < boardHeight(). |
| nIdxTileAni | The tile animation. Must be >= 0 and < getNrTileAniAttrs(). |
|
inlinenoexcept |
Returns the TileAnimator for a certain tile animation.
| oXY | The position (in tiles). Must be within the board. |
| nIdxTileAni | The tile animation. Must be >= 0 and < getNrTileAniAttrs(). |
|
noexcept |
The height of the board in tiles.
|
noexcept |
Inserts a row or column in a rectangle area.
Calls BoardListener::boardPreInsert and BoardListener::boardPostInsert.
If refTiles is null empty tiles are inserted. If it isn't it's size must be equal or bigger than (oArea.m_nW, oArea.m_nH).
Doesn't change the rectangle's cells' owner (level block). The tile animations move (and get removed) with the cell tile.
Examples:
0123456789 0123456789
0 |--------| |--------|
1 | | | |
2 | AaAA | | XxXX | boardInsert(DOWN, {3,2,4,5}, {XxXX})
3 | BbBB | | AaAA |
4 | CcCC | | BbBB | TileAnis of EeEE are removed,
5 | DdDD | | CcCC | the others moved down
6 | EeEE | | DdDD |
7 | | | |
8 | | | |
9 |--------| |--------|
0123456789
0 |--------|
1 | |
2 | BbBB | boardInsert(UP, {3,2,4,5}, {XxXX})
3 | CcCC |
4 | DdDD | TileAnis of AaAA are removed,
5 | EeEE | the others moved up
6 | XxXX |
7 | |
8 | |
9 |--------|
0123456789
0 |--------|
1 | |
2 | XAaA | boardInsert(RIGHT, {3,2,4,5}, {XxXXX})
3 | xBbB |
4 | XCcC | TileAnis of ABCDE (row x=6) are removed,
5 | XDdD | the others moved right
6 | XEeE |
7 | |
8 | |
9 |--------|
0123456789
0 |--------|
1 | |
2 | aAAX | boardInsert(LEFT, {3,2,4,5}, {XxXXX})
3 | bBBx |
4 | cCCX | TileAnis of ABCDE (row x=3) are removed,
5 | dDDX | the others moved left
6 | eEEX |
7 | |
8 | |
9 |--------|
| eDir | The direction of the insertion. |
| oArea | The rectangle. Must be completely within the board and have positive width and height. |
| refTiles | The tiles to be inserted. Can be null. |
|
noexcept |
Modify the cells of given area.
Calls BoardListener::boardPreModify and BoardListener::boardPostModify.
The tile animations and ownership are left unchanged.
| oTileCoords | The modified tiles and their position. Must be all within the board. |
|
noexcept |
Removes a listener to board modifications.
| p0Listener | The listener. Cannot be null. |
|
noexcept |
Scrolls the board contents in a certain direction.
Same as boardInsert with params nX=0, nY=0, nW=boardWidth(), nH=boardHeight() but with a different meaning. It moves the auto scrolled level blocks in the direction of the scroll. In the same way it also moves animations tied to the board. It calls BoardScrollListener listeners.
If a LevelBlock that owns a cell that is about to be scrolled out of the board, it should do something in its BoardScrollListener::boardPreScroll function (provided it is a listener), otherwise it will either be frozen, destroyed or removed.
The caller of this function should expect listeners might keep a reference to the buffer.
A null buffer means all new tiles are empty.
| eDir | The direction of the scroll. |
| refTiles | The tiles to be inserted. Can be null. |
|
noexcept |
Adds a listener to board scrolls.
| p0Listener | The listener. Cannot be null. |
|
noexcept |
Removes a listener to board scrolls.
| p0Listener | The listener. Cannot be null. |
|
noexcept |
Sets the level block owner of a board's cell.
| nX | The x (in tiles). Must be >= 0 and < boardWidth(). |
| nY | The y (in tiles). Must be >= 0 and < boardHeight(). |
| p0LevelBlock | The level block. Can be null. |
|
inlinenoexcept |
Sets the level block owner of a board's cell.
| oXY | The position (in tiles). Must be within the board. |
| p0LevelBlock | The level block. Can be null. |
|
noexcept |
Sets the tile of a board cell.
| nX | The x (in tiles). Must be >= 0 and < boardWidth(). |
| nY | The y (in tiles). Must be >= 0 and < boardHeight(). |
| oTile | The tile. |
Sets the tile of a board cell.
| oXY | The position (in tiles). Must be within the board. |
| oTile | The tile. |
|
noexcept |
Set the tile animator of a cell for a certain tile animation.
| nX | The x (in tiles). Must be >= 0 and < boardWidth(). |
| nY | The y (in tiles). Must be >= 0 and < boardHeight(). |
| nIdxTileAni | The tile animation. Must be >= 0 and < getNrTileAniAttrs(). |
| p0TileAnimator | The tile animator. Can be null. |
| nHash | A number that is passed to the TileAnimator when boardGetTileAniElapsed() calls it. |
|
inlinenoexcept |
Set the tile animator of a cell for a certain tile animation.
| oXY | The position (in tiles). Must be within the board. |
| nIdxTileAni | The tile animation. Must be >= 0 and < getNrTileAniAttrs(). |
| p0TileAnimator | The tile animator. Can be null. |
| nHash | A number that is passed to the TileAnimator when boardGetTileAniElapsed() calls it. |
|
noexcept |
The size of the board in tiles.
|
noexcept |
The width of the board in tiles.
|
noexcept |
Deactivate event.
| p0Event | The event. Cannot be null. |
|
noexcept |
|
protectednoexcept |
Extracts all events from the level.
This can be used for recycling.
|
noexcept |
The game proxy.
|
noexcept |
The game proxy.
|
inlinenoexcept |
The elapsed time since the game start in intervals.
This a shortcut of game().gameElapsed().
|
protectednoexcept |
Signals the start of the game.
This function is called by Game when a new game is started.
|
noexcept |
Declare team completed the game.
| nLevelTeam | The level team that completed the level. |
| bForceOthersFailed | Whether other teams should fail immediately or go on playing. |
| bCreateTexts | Whether to create standard text animations. |
|
noexcept |
Declare team failed the game.
| nLevelTeam | The team that failed. |
| bForceOtherCompleted | If only one other team still playing declare it completed the game. |
| bCreateTexts | Whether to create standard text animations. |
|
noexcept |
Declare player dead.
If it was the last mate of the team gameStatusFailed() for the team is called.
| nLevelTeam | The team of the player. |
| nMate | The mate number of the player. |
| bForceOtherCompleted | If last of a failed team declare the only other team completed the game. |
| bCreateTexts | Whether to create standard text animations. |
|
noexcept |
Technical game over.
| aIssue | Problem description text. |
|
noexcept |
The currently active human players.
|
noexcept |
Get an event by id.
| sId | The string id. |
|
noexcept |
Gets the fall rate of level blocks for this level.
|
noexcept |
Get the requested interval for the level.
This function is called by the game to calculate the next game interval.
|
noexcept |
The level identifier within the game.
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
The number of tile animations for both brick and board cell tiles.
This number is determined when the game is started and corresponds to the size of game().getNamed().tileAnis() at that time.
|
noexcept |
The number of players in the level.
|
noexcept |
The number of teams in the level.
|
noexcept |
Tells whether the event was added to the level.
| p0Event | The event. Cannot be null. |
|
noexcept |
Add a listener to events from other levels.
If the listener already is added this function does nothing.
| p0OthersListener | The listener. Cannot be null. |
|
noexcept |
Removes a listener to events from other levels.
If the listener is not present this function does nothing.
| p0OthersListener | The listener. Cannot be null. |
|
inlinenoexcept |
The preferences.
|
protectednoexcept |
Reinitializes the level instance.
The level view is set to null.
| p0Game | The game. Cannot be null. |
| nLevel | The number to identify the level within the game. |
| refPreferences | The preferences. Cannot be null. |
| oInit | Initialization data. |
|
noexcept |
Sets the fall rate of level blocks for this level.
The LevelBlock::fall() function is called each nFallEachTicks game ticks.
The new value has only effect in the next game tick.
| nFallEachTicks | The new interval in game ticks between level block fall. |
|
noexcept |
Set the requested game interval for the level.
| fMillisec | The new interval im milliseconds. |
|
protectednoexcept |
Set the level view.
| p0View | The view. Can be null. |
|
noexcept |
The level show of the level.
|
noexcept |
The subshow of a level player.
Call this function only if subshowMode() is true.
| nLevelTeam | The level team. |
| nMate | The mate of the team. |
|
noexcept |
The subshow of a level player.
Call this function only if subshowMode() is true.
| nLevelPlayer | The level player. |
|
inlinenoexcept |
Whether each level player has a subshow.
|
noexcept |
Calls the trigger function of an event.
The triggering event must be owned by the same level of this event. This function deactivates the event without setting its trigger time to -1, so that the event's trigger function can find out whether it was supposed to trigger later.
| p0Event | The event. Cannot be null. |
| nMsg | The message. Must be >= -1. |
| nValue | The value. |
| p0TriggeringEvent | The triggering event or null. |
|
noexcept |
Get existing variable.
The variable must exist! Use game().hasVariableId() to find out.
| nId | The variable id. |
| nLevelTeam | The level team or -1 if game variable. |
| nMate | The mate or -1 if team or game variable. |
|
noexcept |
Get existing variable.
The variable must exist! Use game().hasVariableId() to find out.
| nId | The variable id. |
| nLevelTeam | The level team or -1 if game variable. |
| nMate | The mate or -1 if team or game variable. |
|
noexcept |
Get a named widget.
| sWidgetName | The name of the widget. Cannot be empty. |
| nLevelTeam | The level team or -1 if a game widget. |
| nMate | The mate or .1 if a game or team widget. |
1.8.13