Position::Methods
Position
Static initializer. All of the static member variables are initialized here.
Position
Constructs a Position suitable for cloning.
Position(System.Int32[])
Constructs a Position based only on an array of pieces. This constructor assumes the side to move is White, there is no en passant square and neither side can castle.
Position(System.Int32[],System.Byte)
Constructs a Position based on an array of pieces and the side to move. This constructor assumes there is no en passant square and neither side can castle.
Position(System.Int32[],System.Byte,System.Byte)
Constructs a Position based on an array of pieces, the side to move and which side can castle. There is no en passant square.
Position(System.Int32[],System.Byte,System.Byte,System.Byte)
Constructs a Position based on an array of pieces, the side to move, which side can castle and the en passant square.
Position(System.String)
Constructs a Position by parsing as much of the passed FEN position as possible.
BishopMoves(System.Int32,System.UInt64,System.UInt64)
Returns a ulong representing the potential squares for attack or movement based on 'state' of the a8h1 diagonal and 'state' of the h8a1 diagonal logically ORed together.

Returns:
   datatype : UInt64
Clone
Returns a reference to a duplicate of the current Position

Returns:
   datatype : Position
FENPosition(System.Text.StringBuilder)
Generates a standard FEN position.

Returns:
   datatype : string
FENPositionRank(System.Byte,System.Byte,System.Text.StringBuilder)
Formats a rank to the FEN standard.
FindLegalMoves(System.Collections.Stack,System.Collections.Stack)
Checks the legality of each move in 'stkPseudoLegalMoves' and pushes the legal moves to 'stkLegalMoves'.
FormatBoard(System.Text.StringBuilder)
Formats a representation of the current position to be displayed on the Console.
FormatToPgn(dotKnight.Ply,System.Collections.Stack)
Formats the current ply in standard PGN format.

Returns: The PGN formatted move
   datatype : string
GenBlackCaps(System.Collections.Stack)
Generates all of Black's capture moves.
GenBlackCastles(System.Collections.Stack)
Generates Black's Castling moves.
GenBlackKingCaps(System.Collections.Stack,System.UInt64)
Generates Black's King capture moves.
GenBlackKingMoves(System.Collections.Stack,System.UInt64,System.UInt64)
Generates Black's King capture and non-capture moves.
GenBlackKingNonCaps(System.Collections.Stack,System.UInt64)
Generates Black's King non-capture moves.
GenBlackKnightCaps(System.Collections.Stack,System.UInt64)
Generates Black's Knight capture moves.
GenBlackKnightMoves(System.Collections.Stack,System.UInt64,System.UInt64)
Generates Black's Knight capture and non-capture moves.
GenBlackKnightNonCaps(System.Collections.Stack,System.UInt64)
Generates Black's Knight non-capture moves.
GenBlackMoves(System.Collections.Stack)
Generates all of Black's moves. Note that this function does not generate castling moves as this function is called to get Black out of check.
GenBlackNonCaps(System.Collections.Stack)
Generates all of Black's non-capture moves.
GenBlackPawnCaps(System.Collections.Stack,System.UInt64,System.UInt64)
Generates Black's Pawn capture moves.
GenBlackPawnCapsEmptySquare(System.Collections.Stack,System.Byte,System.UInt64)
Generates Black's Pawn moves that attack empty squares.
GenBlackPawnNonCaps(System.Collections.Stack,System.UInt64,System.UInt64)
Generates Black's Pawn non-capture moves.
GenBlackQueenAndBishopCaps(System.Collections.Stack,System.UInt64,System.UInt64,System.UInt64,System.UInt64)
Generates Black's Bishop capture moves as well as Black's Queen capture (diagonal) moves.
GenBlackQueenAndBishopNonCaps(System.Collections.Stack,System.UInt64,System.UInt64,System.UInt64)
Generates Black's Bishop non-capture moves as well as Black's Queen non-capture (diagonal) moves.
GenBlackQueenAndRookCaps(System.Collections.Stack,System.UInt64,System.UInt64,System.UInt64)
Generates Black's Rook capture moves as well as Black's Queen capture (rank and file) moves.
GenBlackQueenAndRookMoves(System.Collections.Stack,System.UInt64,System.UInt64,System.UInt64)
Generates Black's Rook (capture and non-capture) moves as well as Black's Queen (capture and non-capture; rank and file) moves.
GenBlackQueenAndRookNonCaps(System.Collections.Stack,System.UInt64,System.UInt64)
Generates Black's Rook non-capture moves as well as Black's Queen non-capture (rank and file) moves.
GenBlackQueenBishopMoves(System.Collections.Stack,System.UInt64,System.UInt64,System.UInt64,System.UInt64)
Generates Black's Bishop (capture and non-capture) moves as well as Black's Queen (capture and non-capture; diagonal) moves.
GenHashValue
Calculates and returns the Hash value of the current position. This will be used in the checksum portion of the Hash table entry.

Returns:
   datatype : UInt64
GenLegalMoves(System.Collections.Stack)
Generates all legal moves for the side to move and puts them on the passed stack.

Returns: True if the King is in check, False otherwise
   datatype : bool
GenPromotions(System.Byte,System.Byte,System.Int32,System.Collections.Stack)
Generate Promotion moves (for both sides).
GenWhiteCaps(System.Collections.Stack)
Generates all of White's capture moves.
GenWhiteCastles(System.Collections.Stack)
Generates White's Castling moves.
GenWhiteKingCaps(System.Collections.Stack,System.UInt64)
Generates White's King capture moves.
GenWhiteKingMoves(System.Collections.Stack,System.UInt64,System.UInt64)
Generates White's King capture and non-capture moves.
GenWhiteKingNonCaps(System.Collections.Stack,System.UInt64)
Generates White's King non-capture moves.
GenWhiteKnightCaps(System.Collections.Stack,System.UInt64)
Generates White's Knight capture moves.
GenWhiteKnightMoves(System.Collections.Stack,System.UInt64,System.UInt64)
Generates White's Knight capture and non-capture moves.
GenWhiteKnightNonCaps(System.Collections.Stack,System.UInt64)
Generates White's Knight non-capture moves.
GenWhiteMoves(System.Collections.Stack)
Generates all of White's moves. Note that this function does not generate castling moves as this function is called to get White out of check.
GenWhiteNonCaps(System.Collections.Stack)
Generates all of White's non-capture moves.
GenWhitePawnCaps(System.Collections.Stack,System.UInt64,System.UInt64)
Generates White's Pawn capture moves.
GenWhitePawnCapsEmptySquare(System.Collections.Stack,System.Byte,System.UInt64)
Generates White's Pawn moves that attack empty squares.
GenWhitePawnNonCaps(System.Collections.Stack,System.UInt64,System.UInt64)
Generates White's Pawn non-capture moves.
GenWhiteQueenAndBishopCaps(System.Collections.Stack,System.UInt64,System.UInt64,System.UInt64,System.UInt64)
Generates White's Bishop capture moves as well as White's Queen capture (diagonal) moves.
GenWhiteQueenAndBishopMoves(System.Collections.Stack,System.UInt64,System.UInt64,System.UInt64,System.UInt64)
Generates White's Bishop (capture and non-capture) moves as well as White's Queen (capture and non-capture; diagonal) moves.
GenWhiteQueenAndBishopNonCaps(System.Collections.Stack,System.UInt64,System.UInt64,System.UInt64)
Generates White's Bishop non-capture moves as well as White's Queen non-capture (diagonal) moves.
GenWhiteQueenAndRookCaps(System.Collections.Stack,System.UInt64,System.UInt64,System.UInt64)
Generates White's Rook capture moves as well as White's Queen capture (rank and file) moves.
GenWhiteQueenAndRookMoves(System.Collections.Stack,System.UInt64,System.UInt64,System.UInt64)
Generates White's Rook (capture and non-capture) moves as well as White's Queen (capture and non-capture; rank and file) moves.
GenWhiteQueenAndRookNonCaps(System.Collections.Stack,System.UInt64,System.UInt64)
Generates White's Rook non-capture moves as well as White's Queen non-capture (rank and file) moves.
GetOutOfCheckForBlack(System.Collections.Stack,System.Byte)
Generates a Stack of Moves to get the Black King out of check.
GetOutOfCheckForWhite(System.Collections.Stack,System.Byte)
Generates a Stack of Moves to get the White King out of check.
GetPiece(System.Byte)
Returns the piece occupying any given square. If the square is empty the return value is ChessEntities.NoSquare.

Returns:
   datatype : byte
initA8H1Attacks
Initializes the diagonal BitBoards in the a8h1 direction.
InitH8A1Attacks
Initializes the diagonal BitBoards in the h8a1 direction.
InitKingMoves
Initializes the BitBoard arrays for all King moves.
InitKnightMoves
Initializes the BitBoard arrays for Knight moves.
InitPieceValue
Initializes the array containing piece values.
InitRankAndFileAttacks
Initializes the Rank/File BitBoard arrays based on all 256 'signatures' for ranks/files.
IsBlackKingInCheck
Returns True if the Black King is in check.

Returns:
   datatype : bool
IsEmptySquareAttacked(System.Byte)
Is a particular square attacked and if so which square does the attacking piece sit on. Note the purpose of this function is to determine if the opponent is attacking a square. (i.e. If its White's move, does black attack this square?). This is used for empty squares so only non-captures need to be generated.

Returns:
   datatype : byte
IsSquareAttacked(System.Byte)
Is a particular square attacked and if so which square does the attacking piece sit on. Note the purpose of this function is to determine if the opponent is attacking an occupied square. (i.e. If its White's move, does black attack this square?). This is used for occupied squares so only captures need to be generated.

Returns:
   datatype : bool
IsSquareOccupied(System.Int32)
Returns true if the square is occupied with either a black or white piece, false otherwise.

Returns:
   datatype : bool
IsWhiteKingInCheck
Returns True if the White King is in check.

Returns:
   datatype : bool
MakeMove(dotKnight.Ply)
Updates any necessary data elements to reflect the new position based on a Move
MoveClarification(System.Collections.Stack,System.Int32,System.Byte,System.Byte)
Removes all ambiguity for a PGN formatted move. If more than one ply can end on the same square, this function will massage the move by including a file (or rank) as necessary.

Returns:
   datatype : string
PopulateRankWithPieces(System.Byte,System.Byte,System.Text.StringBuilder)
Helper function for 'FormatBoard'. Formats the pieces in the position using proper spacing and color designation.
ProjectMove(dotKnight.Ply)
Checks to see if the King is in check.

Returns: True if the King is in check, False otherwise
   datatype : bool
RemoveMaterial(System.Int32)
Updates the necessary variables to evaluate the material balance of the position when a piece or pawn is captured.

Returns: True if the side to move is in check, false otherwise
   datatype : bool
ReplaceMaterial(System.Int32)
Updates the necessary variables to evaluate the material balance of the position when a piece or pawn is replaced. This occurs during UnMake() and promotion.
RookMoves(System.Int32,System.UInt64,System.UInt64)
Returns a ulong representing the potential squares for attack or movement based on 'state' of the file and 'state' of the rank logically ORed together.

Returns:
   datatype : UInt64
SearchForSquare(System.Collections.Stack,System.Byte)
Searches a Stack containing Ply that matches the ToSquare.

Returns: The FromSquare for the matching Ply if a match is found, NoSquare otherwise
   datatype : byte
ToggleSideToMove
Flips which side has the move.
ToXML(System.Boolean)
Calculates all of the legal moves for this Position for the side to move. It also includes various evaluation metrics of this Position. The moves can be presented in LANH (Long Algebraic Notation Hyphenated). Each node will contain : value and eval_* attributes (eval_material, eval_mobility ... )

Returns: Moves and metrics are returned in XML format.
   datatype : string
UnMakeMove(dotKnight.Ply)
Updates any necessary data to reflect the position before the move was made.
UpdateBitBoards(System.Int32,System.Int32)
Updates the appropriate BitBoards based on the Type of Piece and the Square passed.
UpdatePieceArrayForFEN(System.String,System.Byte[])
Updates the PiecesOnBoard array based on the FEN position passed.
 
Position::Properties
AllPieces
Public interface for the BitBoard representing all of the pieces on the board.
BlackBishopsQueens
Public interface for the BitBoard representing Black's Bishops and Queens (diagonal moves).
BlackKingSquare
Public interface for the Black King's square.
BlackKnights
Public interface for the BitBoard representing Black's Knights.
BlackPawns
Public interface for the BitBoard representing Black's Pawns.
BlackPieces
Public interface for the BitBoard representing all of Black's pieces.
BlackRooksQueens
Public interface for the BitBoard representing Black's Rooks and Queens (Rank and File moves).
EPSquare
Public interface for the current EPSquare.
FiftyMoveDrawCount
Public interface for the 50 move draw count.
PlyCount
Public interface for the ply count. Note that this is NOT the move count.
SideToMove
Public interface for determining which side moves.
WhiteKingSquare
Public interface for the White King's square.
WhiteKnights
Public interface for the BitBoard representing White's Knights.
WhitePawns
Public interface for the BitBoard representing White's Pawns.
WhitePieces
Public interface for the BitBoard representing all of White's pieces.
WhiteQueensBishops
Public interface for the BitBoard representing White's Bishops and Queens (diagonal moves).
WhiteRooksQueens
Public interface for the BitBoard representing White's Rooks and Queens (Rank and File moves).
 
Position::Private Data Members
bbA8H1Attacks
Contains BitBoard representations of all of the possible attacks for all diagonals in the a8h1 direction.
bbAllPieces
BitBoard representation of all of the pieces on the board.
bbAllPieces45L
BitBoard representation of all of the pieces on the board rotated 45 degrees left.
bbAllPieces45R
BitBoard representation of all of the pieces on the board rotated 45 degrees right.
bbAllPieces90R
BitBoard representation of all of the pieces on the board rotated 90 degrees right.
bbBlackKnights
BitBoard representation of all of the Black Knights on the board.
bbBlackPawns
BitBoard representation of all of the Black Pawns on the board.
bbBlackPieces
BitBoard representation of all of the Black pieces on the board.
bbBlackQueensBishops
BitBoard representation of all of the Black Bishops and Queens on the board. For Queens this BitBoard is used to generate diagonal moves.
bbFileAttacks
Contains BitBoard representations of all of the possible File attacks.
bbH8A1Attacks
Contains BitBoard representations of all of the possible attacks for all diagonals in the h8a1 direction.
bbKingAttacks
Contains BitBoard representations of all of the possible attacks for all squares for the King.
bbKnightMoves
Contains BitBoard representations of all of the possible attacks for all squares for the Knight.
bbRankAttacks
Contains BitBoard representations of all of the possible Rank attacks.
bbWhiteKnights
BitBoard representation of all of the White Knights on the board.
bbWhitePawns
BitBoard representation of all of the White Pawns on the board.
bbWhitePieces
BitBoard representation of all of the White pieces on the board.
bbWhiteQueensBishops
BitBoard representation of all of the White Bishops and Queens on the board. For Queens this BitBoard is used to generate diagonal moves.
bbWhiteQueensRooks
BitBoard representation of all of the White Rooks and Queens on the board. For Queens this BitBoard is used to generate rank/file moves.
i50MoveDrawCount
Contains the move count that qualifies for the 50 move draw rule.
iBlackKingSquare
Contains the square the Black King is occupying.
iEPSquare
Contains the EP (en passant) square if applicable. Otherwise it contains ChessEntities.NoSquare.
iPiecesOnBoard
Array containing the pieces on the board.
iPlyCount
Contains the number of ply presently played.
iPositionStatus
The lower 6 bits contain information about the Castling status for both sides. The upper 2 bits are used to determine which side has the move.
iSaveCapturedPiece
Variable used to hold which piece was presently captured if any. Otherwise it contains ChessEntities.NoPiece.
iSaveEPSquare
Variable used to hold the EPSquare for the UnMake() function.
iSavePositionStatus
Variable used to hold the PositionStatus for the UnMake() function.
iWhiteKingSquare
Contains the square the White King is occupying.
PieceValue
Array containing the relative value for each piece.