You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.0 KiB

Possible classes:
GUI
Display the game board
Show the selected first half of the move
Show the list of moves that are performed so far
Show the captured pieces
Show highlighting for the most recent move
Symbol for display?
GameState
Direct storage of piece data in a 2D array (speed of computation)
Know whose turn it is
Be able to set up the starting positions
Be able to perform the move (remove piece if a capture, promote to queen if get to the end)
Square
What pieces (if any) occupies it
Knowledge of whether or not castling, en passant are available
Move
Represents a source and destination square
Knows whether or not it was a capture, check, etc.
Where are the rules going to be programmed in?
A piece has to be aware of other stuff going on around it in order to calculate if a move is legal or not.
What is a piece location useful for?
Checking for legality of moves
Drawing the pieces on the board
Duplicating game states will be easier if we don't have lots of objects attached to the game board.