O'Reilly logo

Game Programming Using Qt by Lorenz Haas, Witold Wysota

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – implementing the game board class

Now we will focus on our data structure. Add a new private member to ChessBoard, a vector of characters that will contain information about pieces on the board:

QVector<char> m_boardData;

Consider the following table that shows the piece type and the letters used for it:

Piece type

White

Black

Time for action – implementing the game board class

King

K

k

Time for action – implementing the game board class

Queen

Q

q

Time for action – implementing the game board class

Rook

R

r

Bishop

B

b

Knight

N

n

Pawn

P

P

You can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required