Public Member Functions | Protected Member Functions | Protected Attributes

Renderer< BoardType > Class Template Reference

Base class for renderers. More...

#include <Renderers/Renderer.hpp>

Inheritance diagram for Renderer< BoardType >:
Listener< Move< BoardType::Coords > >

List of all members.

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

Detailed Description

template<typename BoardType>
class Renderer< BoardType >

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)


Member Function Documentation

template<typename BoardType>
virtual void Renderer< BoardType >::boardChanged (  )  [inline, protected, virtual]

called when a board is set using setBoard

template<typename BoardType>
virtual void Renderer< BoardType >::display (  )  [inline, virtual]

do a draw call

template<typename BoardType>
virtual void Renderer< BoardType >::displayBoard (  )  [pure virtual]

draw call to display the board

Implemented in ConsoleChessDisplay, Renderer2D< Board2DType >, and Renderer2D< ChessBoard >.

template<typename BoardType>
virtual void Renderer< BoardType >::displayPiece ( const Coords &  position  )  [pure virtual]

do a draw call for a piece

Parameters:
position on the board of the piece to draw

Implemented in ConsoleChessDisplay, and Qt2DDisplay.

template<typename BoardType>
void Renderer< BoardType >::setBoard ( const BoardType *  pBoard  )  [inline]

Defines the board to display Can be changed and the fly.

Parameters:
pBoard the new board

Reimplemented in Qt2DDisplay.


Member Data Documentation

template<typename BoardType>
const BoardType* Renderer< BoardType >::m_pBoard [protected]

Board to display


The documentation for this class was generated from the following file:
 All Classes Functions Variables