Base class for renderers. More...
#include <Renderers/Renderer.hpp>
Public Member Functions | |
void | setBoard (const BoardType *pBoard) |
virtual void | display () |
virtual void | displayBoard ()=0 |
virtual void | displayPiece (const Coords &position)=0 |
Protected Member Functions | |
virtual void | boardChanged () |
Protected Attributes | |
const BoardType * | m_pBoard |
Base class for renderers.
A renderer must display the game (using the board). The board to view is set by using setBoard()
. The function display() will print the game using subfunctions displayBoard()
and displayPiece()
. The Renderer is a listener to watch all moves accepted (and so, update the view)
virtual void Renderer< BoardType >::boardChanged | ( | ) | [inline, protected, virtual] |
called when a board is set using setBoard
virtual void Renderer< BoardType >::display | ( | ) | [inline, virtual] |
do a draw call
virtual void Renderer< BoardType >::displayBoard | ( | ) | [pure virtual] |
draw call to display the board
Implemented in ConsoleChessDisplay, Renderer2D< Board2DType >, and Renderer2D< ChessBoard >.
virtual void Renderer< BoardType >::displayPiece | ( | const Coords & | position | ) | [pure virtual] |
do a draw call for a piece
position | on the board of the piece to draw |
Implemented in ConsoleChessDisplay, and Qt2DDisplay.
void Renderer< BoardType >::setBoard | ( | const BoardType * | pBoard | ) | [inline] |
Defines the board to display Can be changed and the fly.
pBoard | the new board |
Reimplemented in Qt2DDisplay.
Board to display