Design and Objects

Fundamental Objects

The chess game should be divided into several objects that share infomation to make the whole program come together and flow. The fundamental objects are the board and the pieces. The board uses the pieces and needs to keep track of where they are at all times. This is simple since the pieces are only moved one at a time. A third fundamental object is one that we shall call a piecedef. It checks to make sure that each piece is moving correctly and is fundamental for the correct playing of the game. The board also uses these objects in order to check for validity of moves. We have this relationship between the fundamental objects:

Interface With the User

To play chess, the user must be able to move the pieces, see them, and all that great stuff. For this, we need another object that we'll call a Driver. In my program, the Driver is a member of the Applet class, but it doesn't have to be. The Driver will process mouse clicks and releases, display list of move, and process clicks on buttons that may occur. Also, it will load all of the images and display. Later, we'll see how the Driver interacts with the board class.

Other objects

Seperate objects are need to find pieces on the board, search for checks and pins, convert pgn to board array values, read pgn from the screen, and perform other task the game may want. These objects all communicate with the driver in some way. My game uses the following objects to perform these task. Here's a map of them and a map of the design of the game in full...

back