Releases: chesskit-app/chesskit-swift
Releases · chesskit-app/chesskit-swift
ChessKit 0.15.0
New Features
- Command line interface, view and test ChessKit features using
swift run chesskit-cli
- See provided usage when running
chesskit-cli
for available commands.
- See provided usage when running
Position
now includes anassessment
property for positional assessments.- Possible values for
assessment
are part of the newPosition.Assessment
enum. - These are based on the standardized Numerical Annotation Glyphs (also used for
Move.Assessment
). Game
andMoveTree
have methods to update positional assessments.
- Possible values for
Improvements
- Rewrote
PGNParser
to be more efficient and reliable.- Now parses PGN text more flexibly, accounting nested variations.
PGNParser.parse(game:)
has replaced the now deprecatedPGNParser.parse(game:startingWith:)
(position is now inferred from the PGN tags).parse(game:)
is now a throwing method with a robust bank of possible errors for better error handling and understanding of why the PGN could not be parsed.Game(pgn:)
is now also a throwing initializer, passing on the error fromPGNParser
.- Now parses
Position.Assessment
(see above).
- Add
Move.Assessment(notation:)
initializer. - Add
all
property toGame.Tags
to return array of all named tags. - Add
CustomStringConvertible
conformance toGame
andMove
.
Bug Fixes
- Fix
SANParser
not parsing en passant captures properly (by Rob Raese). - Fix parsing of
"PlyCount"
,"TimeControl"
, and"SetUp"
PGN tags.
Full Changelog: 0.14.0...0.15.0
ChessKit 0.14.0
New Features
- Add
willPromote()
toBoardDelegate
(by @Amir-Zucker).- Called when pawn reaches last rank but before
Board.completePromotion()
is called.
- Called when pawn reaches last rank but before
Improvements
PGNParser
now parses*
game results (indicating game in progress, abandoned, unknown, etc.).- Add
CustomStringConvertible
conformance toPiece
,Piece.Color
, andPiece.Kind
. - Migrate all unit tests (expect performance tests) from
XCTest
toSwift Testing
.
Bug Fixes
- Fix issue where
MoveTree.endIndex
is not properly updated after the first half move (by @Amir-Zucker). - Fix issue where
BoardDelegate.didPromote()
was called before and after promotion (by @Amir-Zucker). - Fix issue where pawns on the starting rank could hop over pieces in front of them, see Issue #49 (by @joee-ca).
- Fix
SANParser
(andPGNParser
) accepting invalid SANs when they started with a valid SAN (e.g."e44"
which starts with the valid"e4"
).
Breaking Changes
Game(pgn:)
is no longer a failable initializer, it will now always create a non-nil
Game
.
New Contributors
- @Amir-Zucker made their first contribution in #53
Full Changelog: 0.13.0...0.14.0
ChessKit 0.13.0
New Features
BoardDelegate
now notifies when king is in check, and provides the color of the checked king, see Issue #38.Move.checkState
andMove.disambiguation
are now publicly accessible, see Issue #38.
Technical Changes
- Enable Swift 6 language mode package-wide.
Game
andMoveTree
are nowSendable
types.
Full Changelog: 0.12.1...0.13.0
ChessKit 0.12.1
Bug Fixes
- Fix
MoveTree.fullVariation(for:)
returning blank array when.minimum
is passed as the index.- If this index is passed, it will automatically start from the next (valid) index and return the moves for that index.
- In practice this will mean the main variation will be returned (starting from white's first move).
Full Changelog: 0.12.0...0.12.1
ChessKit 0.12.0
Improvements
- Conform more types to
Hashable
such asGame
andMoveTree
. Game.Tag
now publicly exposesname
.Game.Tags
is nowHashable
andSendable
.
Full Changelog: 0.11.0...0.12.0
ChessKit 0.11.0
New Features
- A draw result is now published by
BoardDelegate
when the board encounters a threefold repetition (by @joee-ca). - Convenience directional properties added to
Square
such asup
,down
,left
, andright
to obtain squares in relation to the givenSquare
.
Bug Fixes
File.init(_ number: Int)
now correctly bounds invalid values.- i.e. Values less than 1 become
File.a
and values greater than 8 becomeFile.h
.
- i.e. Values less than 1 become
Technical Changes
- Test coverage has been improved.
- Parsers (
EngineLANParser
,FENParser
,PGNParser
,SANParser
) have been converted from classes to caseless enums.- This should have no effect on existing code since the class versions had private initializers.
Full Changelog: 0.10.0...0.11.0
ChessKit 0.10.0
Improvements
- Update tools version to Swift 5.9 (requires Xcode 15.0 or greater).
- Conform to Swift strict concurrency and add
Sendable
conformance to most objects
Breaking Changes
Game
is now astruct
and no longer conforms toObservableObject
.- If observation semantics are required, consider using
didSet
property observers or an object that utilizes the@Observable
macro.
- If observation semantics are required, consider using
Full Changelog: 0.9.0...0.10.0
ChessKit 0.9.0
Improvements
MoveTree
now conforms toBidirectionalCollection
, allowing for more standard collection-based semantics in Swift.- Should not affect any existing functionality or API usage.
- Several methods on
MoveTree
have been deprecated in favor of theirCollection
counterparts:previousIndex(for:)
→index(before:)
/hasIndex(before:)
nextIndex(for:)
→index(after:)
/hasIndex(after:)
move(at:)
→subscript(_:)
(e.g.tree[index]
)
MoveTree.annotate()
now optionally returns theMove
object after annotation.MoveTree.path()
now returns tuple with named parameters (direction
andindex
).
Bug Fixes
- Removed
CustomDebugStringConvertible
conformance fromBitboard
to avoid affecting allUInt64
debug prints.- To print the string representation of
Bitboard
useBitboard.chessString()
.
- To print the string representation of
Full Changelog: 0.8.0...0.9.0
ChessKit 0.8.0
Improvements
- Add support for draw by insufficient material (by @joee-ca).
- Once this condition is reached
.draw(.insufficientMaterial)
will be published via theBoardDelegate.didEnd(with:)
method.
- Once this condition is reached
- Add unicode variant selector when printing black pawn icon to avoid displaying emoji (by @joee-ca).
Bug Fixes
- Fix issue where king could castle through other pieces (by @TigranSaakyan).
New Contributors
- @joee-ca made their first contribution in #26
- @TigranSaakyan made their first contribution in #28
Full Changelog: 0.7.1...0.8.0
ChessKit 0.7.1
- Fix
MoveTree.previousIndex(for:)
when provided index is one afterminimumIndex
.
Full Changelog: 0.7.0...0.7.1