Commit Graph

148 Commits

Author SHA1 Message Date
Kai S. K. Engelbart 2c5521d2ff Replace old event framework with dev.kske:event-bus:0.0.3 2020-09-11 17:52:53 +02:00
Kai S. K. Engelbart 4566b33522
Convert to Eclipse / Maven project 2020-09-06 15:51:54 +02:00
Kai S. K. Engelbart 72aa8d0881
Reformat everything (mainly to fit 80 character width limit) 2020-08-15 23:25:52 +02:00
Kai S. K. Engelbart 616843b547
Remove AIConfigDialog, simplify some lambdas 2020-08-15 23:25:52 +02:00
Kai S. K. Engelbart 929fd9381e
Refactor for efficiency and concise code
* Change player map implentation in Game to EnumMap
* Add proper toString methods to Piece and MoveNode
* Compact code in MainWindow
* Synchronize methods in Game
2020-08-15 23:25:51 +02:00
Kai S. K. Engelbart 2333021bba
Add missing Javadoc 2020-08-15 23:25:50 +02:00
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 d46a9aa5ff
Implemented saving the last accessed file system path
When loading or saving a game file, the file chooser dialog opens inside
the directory that has been last accessed by the user. In case of no
previous access, the home directory is used instead.

Closes #14
2020-08-15 23:25:48 +02:00
Kai S. K. Engelbart 9a4d9121de
Improved close button UI 2020-08-15 23:25:48 +02:00
Kai S. K. Engelbart baf55a4c96
Added simple close button to tab component 2020-08-15 23:25:47 +02:00
Kai S. K. Engelbart c6db7da698
Added custom tab component 2020-08-15 23:25:46 +02:00
Kai S. K. Engelbart 9b71dbeb82
Fixed setter parameter naming for fullmove number in Log 2020-08-15 23:25:45 +02:00
Kai S. K. Engelbart 00bf4a44ea
Fixed missing end of line chunk in movetext 2020-08-15 23:25:45 +02:00
Kai S. K. Engelbart ac1c857795
Fixed fullmove counters in PGN export 2020-08-15 23:25:44 +02:00
Kai S. K. Engelbart 739c51f265
Including fullmove counters in PGN export 2020-08-15 23:25:43 +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 4cb6e0e08b
Working on SAN serialization of moves
+ SAN generation for castling moves
+ Appending promotion piece symbol in pawn promotion SAN

+ Asking the user to view a generated PGN file
2020-08-15 23:25:42 +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 4dfd218440
Added a PGN file saving routine
+ showFileSaveDialog in DialogUtil
+ Javadoc in Log and PGNDatabase
+ "Save game file" button in MenuBar
+ saveFile method in MainWindow
+ Formatting and result tag in PGNGame tag pair serialization
2020-08-15 23:25:41 +02:00
Kai S. K. Engelbart d6b5442ee9
Added empty save methods to PGNDatabase and PGNGame 2020-08-15 23:25:40 +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 6824b46539
Using reflection in FENString, fixed input field in MainWindow 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 acf6bf36c1
Added RestartEvent to clear move list after game restart 2020-08-15 23:25:34 +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 4f19244d40
Implemented 'go' command in UCI protocol
Closes #5
2020-08-15 23:25:33 +02:00
Kai S. K. Engelbart f7d1758b28
Implemented 'position moves' command in UCI protocol 2020-08-15 23:25:32 +02:00
Kai S. K. Engelbart 05299e3a05
Implemented 'currline' command in UCI protocol 2020-08-15 23:25:31 +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 de015a64fb
Moved loadFile method to MainWindow, removed redundancies 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 3603153254
Added FENString class 2020-08-15 23:25:27 +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 141ca7ba26
Created io package, moved IO-related classes 2020-08-15 23:25:26 +02:00
Kai S. K. Engelbart e4daec64b1
Added PGNDatabaseTest and test file 2020-08-15 23:25:25 +02:00
Kai S. K. Engelbart 258db80f36
Replaced game configuration dialog by a JOptionPane 2020-08-15 23:25:24 +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 86b696ef4c
Implemented game loading from FEN file 2020-08-15 23:25:23 +02:00
Kai S. K. Engelbart a0b4405976
Added file chooser dialog, renamed GameConfigurationDialog to DialogUtil 2020-08-15 23:25:22 +02:00
Kai S. K. Engelbart a76e3cc904
Replaced LogPanel by a JList inside GamePane with a custom cell renderer 2020-08-15 23:25:22 +02:00
Kai S. K. Engelbart 3bb4fd211c
Fixed texture scaling method in TextureUtil 2020-08-15 23:25:21 +02:00
Kai S. K. Engelbart 4e1682ac16
Added PGNDatabase and PGNGame classes with support for PGN parsing 2020-08-15 23:25:20 +02:00