class BoardFunctions
package chess.fen
Supplies functions to build or print board representations and create the field placement portion of FEN records from board representations.
Static methods
staticbuildBoardFromFieldPlacement(fieldPlacement:String):String
Returns a board reprsentation string that contains 8 times 8 characters in dextrograd order from White's perspective (starting with A8 in the upper left), separated by LF ("\n").
If fieldPlacement
is not valid, the result is mostly unspecified.
If fieldPlacement
contains illegal characters, an IllegalCharacterException
may be thrown.
Parameters:
fieldPlacement | The field placement portion of a FEN record. |
---|
staticcreateFieldPlacementFromBoardString(visualization:String, ?borderMode:BorderMode):String
Returns the field placement portion usable in FEN record strings from a visualization.
If visualization
is invalid, the result is mostly unspecified.
If visualization
contains illegal characters, an IllegalCharacterException
may be thrown.
If borderMode
is not specified, BorderMode.OFF
is used.
If borderMode
is specified, but invalid, an UnknownBorderModeException
is thrown.
Parameters:
visualization | A String representing all fields of the board in dextrograd order from White's perspective. It needs to be LF separated (\n) after every row (therefore after every eight characters). |
---|---|
borderMode | The BorderMode the visualization was created with. |
staticprintBoard(board:String, ?borderMode:BorderMode):Void
Prints a visualization of the board from a board string.
If board
is invalid, the result is mostly unspecified.
If board
contains data for too many rows, an UnexpectedRowAmountException
is thrown.
If borderMode
is not specified this function behaves as if BorderMode.OFF
was specified.
If borderMode
is specified, but invalid, an UnknownBorderModeException
is thrown.
Parameters:
board | A String representing all fields of the board in dextrograd order from White's perspective. It needs to be LF separated (\n) after every row (therefore after every eight characters). |
---|---|
borderMode | Any border mode. |
staticprintBoardFromFENObject(fEN:FEN, ?borderMode:BorderMode):Void
Prints a visualization of the board from a FEN object.
If the field placement portion of fEN
is invalid, the result is mostly unspecified.
If the field placement portion of fEN
contains data for too many rows, an UnexpectedRowAmountException
is
thrown.
If borderMode
is not specified this function behaves as if BorderMode.OFF
was specified.
If borderMode
is specified, but invalid, an UnknownBorderModeException
is thrown.
Parameters:
fEN | Any valid FEN object. |
---|---|
borderMode | Any border mode. |
staticprintBoardFromFieldPlacement(fieldPlacement:String, ?borderMode:BorderMode):Void
Prints a visualization of the board from a the field placement portion of a FEN record.
If fieldPlacement
is invalid, the result is mostly unspecified.
If fieldPlacement
contains data for too many rows, an UnexpectedRowAmountException
is thrown.
If borderMode
is not specified this function behaves as if BorderMode.OFF
was specified.
If borderMode
is specified, but invalid, an UnknownBorderModeException
is thrown.
Parameters:
fieldPlacement | Any valid field placement portion of a FEN record. |
---|---|
borderMode | Any border mode. |
staticprintBoardFromFullFENString(fENString:String, ?borderMode:BorderMode):Void
Prints a visualization of the board from a FEN record string.
If fENString
is invalid, the result is mostly unspecified.
If fENString
contains data for too many rows, an UnexpectedRowAmountException
is thrown.
If borderMode
is not specified this function behaves as if BorderMode.OFF
was specified.
If borderMode
is specified, but invalid, an UnknownBorderModeException
is thrown.
Parameters:
fENString | Any valid FEN record string. |
---|---|
borderMode | Any border mode. |