Commit Graph

47 Commits

Author SHA1 Message Date
Kai S. K. Engelbart f4768b7ac3
Working on move history navigation
* Enabled "next" and "previous" buttons
* Added corresponding methods to Board
* Added Move#invert()
* Rendering variation count in MoveNodeRenderer

The added functionality does not work correctly at the moment. This is
probably caused due to missing synchronization between the state of the
board, the game and the user interface.
2020-08-15 23:25:50 +02:00
Kai S. K. Engelbart b32a4f2414
Fixed some Javadoc and formatting 2020-08-15 23:25:49 +02:00
Kai S. K. Engelbart 4723127bc8
Implemented saving to PGN file
+ copyVariations parameter in copy constructors of Board and Log

This procedure still required work in the form of efficiently rewinding
the board to the first position for SAN move extraction and shortening
SAN moves to the smallest possible representation.
2020-08-15 23:25:43 +02:00
Kai S. K. Engelbart 6cb0da80d7
Created Move#fromSAN, moved implementation from Board 2020-08-15 23:25:41 +02:00
Kai S. K. Engelbart e070bb584f
Fixed color switching button
* Renamed RestartEvent to GameStartEvent
* Moved event trigger to Game
* Renamed GameState to BoardState
* Added BoardState instance to MoveEvent
* Disabling the color switching button when a checkmate or stalemate is
reached

Fixes #1
2020-08-15 23:25:39 +02:00
Kai S. K. Engelbart 1dc97ba3de
Added pawn promotion selection
* Letting a NaturalPlayer select the promotion piece with a combo box
* Optimized reflection use in PawnPromotion
* Changed toString method of Move to use LAN

Closes #9
2020-08-15 23:25:38 +02:00
Kai S. K. Engelbart e92664dd07
Added pawn promotion support to LAN 2020-08-15 23:25:37 +02:00
Kai S. K. Engelbart 17677e6858
Removed Type enumeration from Piece class 2020-08-15 23:25:37 +02:00
Kai S. K. Engelbart 2821f30dbe
Implemented proper pawn promotion
* Moved move execution and reversion to the Move class
* Removed Move.Type enumeration
* Added Move subclasses Castling, EnPassant and PawnPromotion
* Generating all four possible pawn promotions in the Pawn class
* Temporarily removed special move support from NaturalPlayer
2020-08-15 23:25:36 +02:00
Kai S. K. Engelbart b79c592c67
Created getters for all fields in Move 2020-08-15 23:25:35 +02:00
Kai S. K. Engelbart 9aea4bd9d4
Moved board evaluation logic to MoveProcessor 2020-08-15 23:25:35 +02:00
Kai S. K. Engelbart aa09674791
Fully implemented castling conditions
Closes #8
2020-08-15 23:25:33 +02:00
Kai S. K. Engelbart ae9abded19
Changed class Javadoc to use @author and @since tags 2020-08-15 23:25:30 +02:00
Kai S. K. Engelbart 966c959786
Removed old FEN string methods, fixed FEN regex 2020-08-15 23:25:29 +02:00
Kai S. K. Engelbart 3821ce313d
Moved castling right logging to Log
* Removed move counter from Piece
* Added castling right array to MoveNode and Log
* Removed castling right map from Board
* Added castling right serialization and deserialization to FENString
* Modified LogTest
2020-08-15 23:25:28 +02:00
Kai S. K. Engelbart 7138905501
Enhanced FENString class, added unit test and Board#equals() 2020-08-15 23:25:28 +02:00
Kai S. K. Engelbart 41b75d415d
Renamed FEN string fullmove counter to fullmove number 2020-08-15 23:25:26 +02:00
Kai S. K. Engelbart cbf110c28d
Improved PGN parsing, added PGN file loading 2020-08-15 23:25:24 +02:00
Kai S. K. Engelbart c16395fe1f
Renamed SAN-like coordinate notation to LAN, added SAN support to Board 2020-08-15 23:25:20 +02:00
Kai S. K. Engelbart 9c6faae6ba
Moved MoveNode into a separate file 2020-08-15 23:25:18 +02:00
Kai S. K. Engelbart 69261303c5
Fixed memory leak, improved copy constructors 2020-08-15 23:25:17 +02:00
Kai S. K. Engelbart 06ab01f585
Fixed Log with respect to variations 2020-08-15 23:25:16 +02:00
Kai S. K. Engelbart 1723c44524
Added variations in Log, added LogTest 2020-08-15 23:25:15 +02:00
Kai S. K. Engelbart bd523018f7
Refactoring
- Simplified FEN-string generation
- Made GameConfigurationDialog a utility class
2020-08-15 23:25:14 +02:00
Kai S. K. Engelbart 3f2e7183dd
Refactoring and documentation, improved FEN integration
+ Adding a new game when loading a FEN string
+ Loading multiple FEN files with drag and drop
2020-08-15 23:25:13 +02:00
Kai S. K. Engelbart 20e9c8b36e
Fixed documentation 2020-08-15 23:25:08 +02:00
Kai S. K. Engelbart c24613ba59
Improved documentation in Board 2020-08-15 23:25:07 +02:00
Kai S. K. Engelbart ae6c618b40
Implemented loadFromFen method in Board 2020-08-15 23:25:06 +02:00
Kai S. K. Engelbart db407122a3
Cleaned up and improved Log
+ Current log state properties
- Removed Log delegates from Board
2020-08-15 23:25:05 +02:00
Kai S. K. Engelbart 9d7d84302e
Working on board loading from FEN-encoded string 2020-08-15 23:25:03 +02:00
Kai S. K. Engelbart e6d4d37848
Implemented LogFrame, added menu item for opening it 2020-08-15 23:25:02 +02:00
Kai S. K. Engelbart 8077aaafdb
Implemented en passant 2020-08-15 23:24:58 +02:00
Kai S. K. Engelbart 20ccb2aeef
Added log resetting, disabled resizing in MainFrame 2020-08-15 23:24:55 +02:00
Kai S. K. Engelbart b99c0f67f0
Fixed engine menu reloading on engine addition 2020-08-15 23:24:53 +02:00
Kai S. K. Engelbart 3be4c042bb
Added en passant availability logging and FEN string export 2020-08-15 23:24:53 +02:00
Kai S. K. Engelbart 686b76ed8a
Fixed FEN string export when board is in start position 2020-08-15 23:24:52 +02:00
Kai S. K. Engelbart dc67b624ce
Moved activeColor, fullmoveCounter and halfmoveClock to Log 2020-08-15 23:24:50 +02:00
Kai S. K. Engelbart 5aa48edb93
Added engine info serialization and integration into MenuBar 2020-08-15 23:24:50 +02:00
Kai S. K. Engelbart a6fcaee70e
Fixed castling, added castling export to FEN
+ isFreePath implementation in Piece
- Removed isFreePath from Bishop, Rook, Queen and King
+ canCastleKingside and canCastleQueenside methods in King
+ Castling rights record in Board + FEN export

+ equals method in Position
+ UCI 'position startpos' command
- Switched to Java 8 compliance for compatibility reasons
2020-08-15 23:24:46 +02:00
Kai S. K. Engelbart 46b74a527d
First working UCI implementation
+ bestmove, position and go command implementations
+ Move initialization from algebraic notation
+ FEN string generation
2020-08-15 23:24:45 +02:00
Kai S. K. Engelbart fe8ae1826e
Added castling, fixed some minor bugs 2020-08-15 23:24:33 +02:00
Kai S. K. Engelbart c7bac23420
Added positional board evaluation 2020-08-15 23:24:31 +02:00
Kai S. K. Engelbart 9c19b13785
Added move history and pawn promotion
+ Log class for move history
+ LoggedMove class with piece captured by the logged move
- Made move reversion easier
+ MoveType for recognizing special moves
+ MoveType determination during move generation and validation
2020-08-15 23:24:31 +02:00
Kai S. K. Engelbart 8283866d62
Fixed rendering
+ Cloning support in Board and Piece
- Using clones for board operations that interfere with rendering
- Fixed repaint calls
+ Unit test for testing board cloning
2020-08-15 23:24:28 +02:00
Kai S. K. Engelbart 31c393150b
Fixed checkmate detection, simplified event handling 2020-08-15 23:24:27 +02:00
Kai S. K. Engelbart f4b399ae43
Added simple (yet surprisingly effective) AI player
+ AIPlayer class
+ Evaluation method in Board
+ AI vs AI button in GameModeDialog (produces a rendering delay)
2020-08-15 23:24:27 +02:00
Kai S. K. Engelbart e8e040669c
Improved package structure
- Renamed the piece package into board
- Moved Board, Move and Position into the board package
2020-08-15 23:24:25 +02:00