FenUtility

class FenUtility(string: String, whiteStartingRow: Int, whitePromotionRow: Int, blackStartingRow: Int, blackPromotionRow: Int, pawnPromotions: List<(Player) -> Piece2D>)

FEN notation utility This class is able to decode a FEN string and return the piece placement and status of the game.

Constructors

FenUtility
Link copied to clipboard
fun FenUtility(string: String, whiteStartingRow: Int = 1, whitePromotionRow: Int = 7, blackStartingRow: Int = 6, blackPromotionRow: Int = 0, pawnPromotions: List<(Player) -> Piece2D> = listOf(::Queen, ::Bishop, ::Knight, ::Rook))

Functions

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
extendFenPieces
Link copied to clipboard
fun extendFenPieces(char: Char, piece: (Player) -> Piece2D)
Adds new mapping from char to piece.
extendFenPiecesCaseSensitive
Link copied to clipboard
fun extendFenPiecesCaseSensitive(char: Char, whitePiece: (Player) -> Piece2D, blackPiece: (Player) -> Piece2D)
Adds new mapping from char to piece case sensitive.
hashCode
Link copied to clipboard
open fun hashCode(): Int
initBoardWithFEN
Link copied to clipboard
fun initBoardWithFEN(board: Board2D, player1: Player, player2: Player)
Initialises a given board with the piece placement in the FEN string.
toString
Link copied to clipboard
open fun toString(): String

Properties

activeColour
Link copied to clipboard
var activeColour: Int = 0
blackPromotionRow
Link copied to clipboard
val blackPromotionRow: Int = 0
blackStartingRow
Link copied to clipboard
val blackStartingRow: Int = 6
p1CanCastleLeft
Link copied to clipboard
val p1CanCastleLeft: Boolean
p1CanCastleRight
Link copied to clipboard
val p1CanCastleRight: Boolean
p2CanCastleLeft
Link copied to clipboard
val p2CanCastleLeft: Boolean
p2CanCastleRight
Link copied to clipboard
val p2CanCastleRight: Boolean
pawnPromotions
Link copied to clipboard
val pawnPromotions: List<(Player) -> Piece2D>
string
Link copied to clipboard
val string: String
whitePromotionRow
Link copied to clipboard
val whitePromotionRow: Int = 7
whiteStartingRow
Link copied to clipboard
val whiteStartingRow: Int = 1