diff --git a/assets/UML.drawio b/assets/UML.drawio new file mode 100644 index 0000000..c3d7ad0 --- /dev/null +++ b/assets/UML.drawio @@ -0,0 +1,286 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/UML.svg b/assets/UML.svg index e537f9d..c48e7ef 100644 --- a/assets/UML.svg +++ b/assets/UML.svg @@ -1,4 +1,4 @@ -«Abstract»Piece- PieceColor: Color+ Piece(Color)+ getMoveDomain() : Direction[] + getColor() : Color+ getSymbol() : Char+ getType() : Type+ hasMoved() : bool«Final»Pawn + getMoveDomain() : Direction[]«Final»King + getMoveDomain() : Direction[]«Final»Queen + getMoveDomain() : Direction[]«Final»Rook + getMoveDomain() : Direction[]«Final»Bishop + getMoveDomain() : Direction[]«Final»Knight + getMoveDomain() : Direction[]«Enum»TypePawnKingQueenRookBishopKnight«Enum»Color White BlackUse«Final»ChessBoard- Board: Piece[64]+ ChessBoard()+ getPiece(idx : int) : Piece+ getPiece(x : int, y : int) : Piece+ movePiece(from: int, to: int) : Optional<Move>+ isCheck(color : Color) : bool+ isCheckMate(color : Color) : bool10..64UseModelController«Final»ChessGame- board: ChessBoard- state: GameState- view: GameView- history: List<Move>+ start(): void+ processTurn(from: int, to: int) : void+ getGameState() : GameState- endTurn() : void- switchPlayer() : void- checkGameEnd() : void«Final»«Record»GameStateactivePlayer: Colorstatus: GameStatus11«Enum»GameStatus ACTIVE WHITE_WINS BLACK_WINS STALEMATEView«Interface»GameView+ displayBoard(board: ChessBoard): void+ showMessage(msg: String) : void+ showError(errorMsg: String) : void+ showGameOver(status: GameStatus) : void+ setController(controller: ChessGame) : voidConsoleView- controller: ChessGame- scanner: Scanner+ displayBoard(board: ChessBoard): void+ showMessage(msg: String) : void+ showError(errorMsg: String) : void+ showGameOver(status: GameStatus) : void+ setController(controller: ChessGame) : voidSwingView- controller: ChessGame- frame: JFrame- boardPanel: JPanel- squares: JButton[64]+ displayBoard(board: ChessBoard): void+ showMessage(msg: String) : void+ showError(errorMsg: String) : void+ showGameOver(status: GameStatus) : void+ setController(controller: ChessGame) : void«implements»«implements»«Final»«Record»Move start: int end: int isCapture: bool isCastle: bool isEnPassant: bool isCheck: bool movedPiece: Type promotedTo: Type capturedPieceColor: Color capturedPieceType: Type1*ServicePGNWriter+ write(List<Move>): voidPGNReader+ read(): List<Move>UseUse \ No newline at end of file +«Abstract»Piece- pieceColor: Color- movedBefore: boolean+ Piece(Color)+ getMoveDomain() : Direction[] + getColor() : Color+ getSymbol() : Char+ getType() : Type+ hasMoved() : bool«Final»Pawn + getMoveDomain() : Direction[]«Final»King + getMoveDomain() : Direction[]«Final»Queen + getMoveDomain() : Direction[]«Final»Rook + getMoveDomain() : Direction[]«Final»Bishop + getMoveDomain() : Direction[]«Final»Knight + getMoveDomain() : Direction[]«Enum»TypePAWNKINGQUEENROOKBISHOPKNIGHT«Enum»Color WHITE BLACKUse«Final»ChessBoard- board: Piece[64]+ ChessBoard()+ getPiece(idx : int) : Piece+ getPiece(x : int, y : int) : Piece+ movePiece(from: int, to: int) : Optional<Move>+ isCheck(color : Color) : bool+ isCheckMate(color : Color) : bool10..64UseModelController«Final»ChessGame- board: ChessBoard- state: GameState- view: GameView- history: List<Move>+ start(): void+ processTurn(from: int, to: int) : void+ getGameState() : GameState- endTurn() : void- switchPlayer() : void- checkGameEnd() : void«Final»«Record»GameStateactivePlayer: Colorstatus: GameStatus11«Enum»GameStatus ACTIVE WHITE_WINS BLACK_WINS STALEMATEView«Interface»GameView+ displayBoard(board: ChessBoard): void+ showMessage(msg: String) : void+ showError(errorMsg: String) : void+ showGameOver(status: GameStatus) : void+ setController(controller: ChessGame) : voidConsoleView- controller: ChessGame- scanner: Scanner+ displayBoard(board: ChessBoard): void+ showMessage(msg: String) : void+ showError(errorMsg: String) : void+ showGameOver(status: GameStatus) : void+ setController(controller: ChessGame) : voidSwingView- controller: ChessGame- frame: JFrame- boardPanel: JPanel- squares: JButton[64]+ displayBoard(board: ChessBoard): void+ showMessage(msg: String) : void+ showError(errorMsg: String) : void+ showGameOver(status: GameStatus) : void+ setController(controller: ChessGame) : void«implements»«implements»«Final»«Record»Move start: int end: int isCapture: bool isCastle: bool isEnPassant: bool isCheck: bool movedPiece: Type promotedTo: Type capturedPieceColor: Color capturedPieceType: Type1*ServicePGNWriter+ write(List<Move>): voidPGNReader+ read(): List<Move>UseUse«Enum»Direction NORTH SOUTH EAST WEST NORTH_EAST NORTH_WEST SOUTH_EAST SOUTH_WEST KNIGHT_NNE KNIGHT_ENE KNIGHT_ESE KNIGHT_SSE KNIGHT_SSW KNIGHT_WSW KNIGHT_WNW KNIGHT_NNW PAWN_DOUBLE_NORTH PAWN_DOUBLE_SOUTH - dx - dy + getDx() : int + getDy() : int + getFlatOffset() : intUse \ No newline at end of file diff --git a/assets/UML_dark.png b/assets/UML_dark.png deleted file mode 100644 index 5329b99..0000000 Binary files a/assets/UML_dark.png and /dev/null differ diff --git a/assets/UML_light.png b/assets/UML_light.png deleted file mode 100644 index ecd57e4..0000000 Binary files a/assets/UML_light.png and /dev/null differ
«Abstract»
Piece
- PieceColor: Color
+ Piece(Color)
+ getMoveDomain() : Direction[]
+ getColor() : Color
+ getSymbol() : Char
+ getType() : Type
+ hasMoved() : bool
«Final»
Pawn
King
Queen
Rook
Bishop
Knight
«Enum»
Type
PawnKingQueen
Color
ChessBoard
- Board: Piece[64]
+ ChessBoard()
+ getPiece(idx : int) : Piece
+ getPiece(x : int, y : int) : Piece
+ movePiece(from: int, to: int) : Optional<Move>
+ isCheck(color : Color) : bool
+ isCheckMate(color : Color) : bool
«Final»ChessGame
- board: ChessBoard- state: GameState
- view: GameView
- history: List<Move>
+ start(): void+ processTurn(from: int, to: int) : void
+ getGameState() : GameState
- endTurn() : void
- switchPlayer() : void
- checkGameEnd() : void
«Record»GameState
activePlayer: Colorstatus: GameStatus
GameStatus
«Interface»GameView
+ displayBoard(board: ChessBoard): void+ showMessage(msg: String) : void
+ showError(errorMsg: String) : void
+ showGameOver(status: GameStatus) : void
+ setController(controller: ChessGame) : void
ConsoleView
- controller: ChessGame
- scanner: Scanner
SwingView
- frame: JFrame
- boardPanel: JPanel
- squares: JButton[64]
«Record»
Move
start: int end: int
isCapture: bool
isCastle: bool
isEnPassant: bool
isCheck: bool
PGNWriter
+ write(List<Move>): void
PGNReader
+ read(): List<Move>
- pieceColor: Color
- movedBefore: boolean
PAWNKINGQUEEN
ROOK
BISHOP
KNIGHT
- board: Piece[64]
Direction