JLightChessLib Code
Purpose is to provide a very simple and well documented chess library.
Status: Abandoned
Brought to you by:
laurentdu64
File | Date | Author | Commit |
---|---|---|---|
src | 2012-10-09 |
![]() |
[51439a] I've added support for i18n : for thrown except... |
README.txt | 2012-10-09 |
![]() |
[48f949] Updated the README file. |
gpl-3.0.txt | 2012-03-19 |
![]() |
[4989ed] First commit : not usable yet. |
JLightChessLib : another chess library. --------------------------------------- JLightChessLib is a chess library written in order to have a minimum set of functionality : => Validating moves => Manage history : with main line and variations management for each node. Also, note that it was not designed to be very fast, so you may not use it in order to code an engine. Now, there is a little new feature : the library takes into account the 50 moves rule, and the chess client is notified whenever we reach this limit. I've also written a demo application using this library : https://sourceforge.net/projects/lightchslibdemo/ (I would like to apologize as it is poorly documented/commented). Built with oracle java jdk 7 : check your java version if you encounters usage problems. ================================= History ================================= 0.7.0) I've added intertionalization support : now messages are translated into english or french. 0.6.8) -- I've corrected a big bug in the FenNotationConverter class : the player turn was inverted for the parsing/decoding (it was coded white turn instead of black turn and vice versa). -- I've nearly completely changed the class ChessHistoryNode. -- The method getPromotionPieceKind() of the interface PromotionListener now requires a boolean, for saying whether it is for the white pieces owner. -- I've corrected a incoherence in the 50 moves rule count : in some code I based myself on half moves, and in some other code I based myself on full moves count. 0.6.6) The library now has a new errors notification management : whereas before it threw ForbiddenMoveException, now it use an Observer Pattern. User error notifiers must implement the interface UserMessagesNotifier, and the chess client classes responsible for showing errors to user must implement UserMessagesShower and register to the ChessGame ChessBoard (which is an implementer of UserMessagesNotifier). Moreover, the library now updates the 50 moves rule counter after every move (but not when just reading history). And whenever the game reach the 50 moves count, the game is registered as a draw, chess client is notified, and no more move can be added (except if we go back in history and change at least one move to a pawn move, or a capture move, so that the counter is reset). 0.6.4) I've added two useful methods in ChessBoard and ChessBoardCell classes (located in the core package) : -> ChessBoard now has a public method checkForPositionValidity() that throw an exception is the current position is invalid (pawns located on the 1st/8th rank, kings too close, ...). -> ChessBoardCell now has a isAdjacentTo(ChessBoardCell) method, that returns true if the cell which receive the message is adjacent to the other cell to test. 0.6.2) An important bug fix !!! When setting a new position with a fen code, the empty cells were not "erased", but instead just skipped, so that the kept their old values !!! 0.6.0) The following features has been implemented and successfully tested. The moves validator is fully functional : even en passant capture, castling trying to escape from chess or doing a move that would put your king in chess, are checked. There is also an interface in order to define a callback, letting you choose the way the user will be able to choose its promotion piece.