java.lang.Object
app.chess.san.SANDecoder
Utility class for decoding moves from standard algebraic notation
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescription(package private) static ChessPieceKind
charToKind
(char c) decodeMove
(GameView<ChessMove, ChessPiece> chess, int player, String move) (package private) static ChessPiece
getMatchingPiece
(GameView<ChessMove, ChessPiece> chess, int player, ChessPieceKind kind, Field targetField, SANDecoder.Modifiers modifiers) Get a piece that can move to a given field and meet criteria(package private) static Castle
kingSideCastle
(GameView<ChessMove, ChessPiece> chess, int player) (package private) static SANDecoder.Modifiers
(package private) static ChessPieceKind
(package private) static Castle
queenSideCastle
(GameView<ChessMove, ChessPiece> chess, int player) (package private) static Field
targetField
(String move)
-
Method Details
-
decodeMove
-
kingSideCastle
-
queenSideCastle
-
getMatchingPiece
static ChessPiece getMatchingPiece(GameView<ChessMove, ChessPiece> chess, int player, ChessPieceKind kind, Field targetField, SANDecoder.Modifiers modifiers) Get a piece that can move to a given field and meet criteriaThrows InvalidSANMove if it cannot unambiguously determine the piece
- Parameters:
chess
- chess game that provides list of movesplayer
- player that makes the movekind
- kind of the piecetargetField
- target fieldmodifiers
- additional information- Returns:
- list of matching pieces
-
pieceKind
-
charToKind
-
targetField
-
modifiers
-