Class Diagram for the Chess Game
Learn to create a class diagram for the chess game using the bottom-up approach.
We'll cover the following...
We’ll create the class diagram for the chess game. In the class diagram, we will first design the classes and then identify the relationship between classes according to the requirements for the chess game problem.
Components of Chess
As mentioned earlier, we'll follow the bottom-up approach to designing a class diagram for the chess game.
Box
A Box
is a specific position/block on the 8x8 chessboard which is defined by row x and column y, respectively.
Chessboard
A Chessboard
is the 8x8 board that stores all the current game's active pieces. It is identified by the date of its creation and can be updated or reset.
Piece
A chess Piece
can only be black or white in color. It might be alive or killed depending on the moves made by the opposition. There can be six types of pieces (Rook
, Pawn
, King
, Queen
, Knight
, and Bishop
derived from Piece
) that have their respective moves based on the rules of the game which decides whether they are eligible to move or not.
Move
A Move
is the displacement of a Piece
from one Box
to another on the chessboard. It may or may not kill a piece of the opposing player.
Account, Player, and Admin
The Account
class is a parent class that has two types: Player
...