Public Member Functions | Protected Member Functions

Qt2DDisplay Class Reference

Inheritance diagram for Qt2DDisplay:
Renderer2D< ChessBoard > Renderer< ChessBoard > Listener< Move< ChessBoard::Coords > >

List of all members.

Public Member Functions

 Qt2DDisplay (QWidget *parent=NULL)
void notify (const Move< ChessBoard::Coords > &move)
 notification of a new move played
void displayPiece (const ChessBoard::Coords &position)
 create the piece corresponding to the position
void setBoard (const ChessBoard *pBoard)
void setRules (const ChessRules *pRules)
 Set the rules to play with.
Q_SLOT void displayHelper (QPointF pos, int color)
 Displays helpers Helpers show which moves are available :

  • Green is for possible moves
  • Blue if for a move eating a piece
  • Red is for piece attacking you.

Q_SLOT void stopHelper ()
 Stop to display helpers Removes all helpers.

Protected Member Functions

void resizeEvent (QResizeEvent *event)

Constructor & Destructor Documentation

Qt2DDisplay::Qt2DDisplay ( QWidget *  parent = NULL  )  [explicit]
Parameters:
parent 

Member Function Documentation

void Qt2DDisplay::displayHelper ( QPointF  pos,
int  color 
)

Displays helpers Helpers show which moves are available :

  • Green is for possible moves
  • Blue if for a move eating a piece
  • Red is for piece attacking you.

Parameters:
position where the click was
color the color of the piece clicked
void Qt2DDisplay::displayPiece ( const ChessBoard::Coords position  )  [inline, virtual]

create the piece corresponding to the position

Parameters:
position 

Implements Renderer< ChessBoard >.

void Qt2DDisplay::notify ( const Move< ChessBoard::Coords > &  move  )  [virtual]

notification of a new move played

Parameters:
move 

Implements Listener< Move< ChessBoard::Coords > >.

void Qt2DDisplay::setBoard ( const ChessBoard pBoard  ) 

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

Parameters:
pBoard the new board

Reimplemented from Renderer< ChessBoard >.

void Qt2DDisplay::setRules ( const ChessRules pRules  )  [inline]

Set the rules to play with.

Parameters:
pRules 

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