Table of Contents

Graphics Reacting to Player Actions

When an action is processed by the GameCore, for example when a player takes a new puzzle, the game graphics need to respond to it.

The GraphicsManager abstract class provides a way for different types to access the GameCore. The GameGraphicsSystem calls the Init(GameCore) method of all registered GraphicsManagers at the start of the game. They can use it to connect to the game listener interfaces provided by the Project L Core library, which are documented here.

For example, the TetrominoCountsColumn, which represents one column in the piece zone, is a ITetrominoCollectionListener because it listens to the changes in the tetromino collection of a player. It is however also a ITetrominoCollectionNotifier because the PieceZoneManager (who is also a ITetrominoCollectionListener) needs to be notified when a tetromino count reaches zero, so that it can gray out the corresponding TetrominoButton.