Unit ChessBrd |
-------------------------------------------------------------------------- ChessBoard Component for Delphi2 and Delphi3 Version 3.02 - April 3, 1998 Author: Daniel Terhell, Resplendence Sp contains translated source from Tom's Simple Chess Program and graphics from Andrew Gate --------------------------------------------------------------------------
Classes |
TChessBrd -
TChessThread - The thinking thread contains mainly code from Tom's Simple Chess Program:
Functions |
Register -
Types |
CanStillCastle
CastleSet
CoordSet
DisplayCoords
gen_rec
hist_rec
MoveInfo
moverec
move_bytes
pBoolean
pCastleSet
pGenRec
pieces
pSquare
pThreadPriority
Square
TCaptureEvent
TMoveEvent
TMoveFunc
TOneSquareEvent
TPromotionEvent
TThinkEvent
Constants |
BISHOP
Black
DARK
EMPTY
HIST_STACK
KING
KNIGHT
LIGHT
MOVE_STACK
NoPiece
PAWN
QUEEN
ROOK
SetAndrew40Str
versionStr
White
Variables |
Functions |
Types |
CanStillCastle=(WhiteKingSide, WhiteQueenSide, BlackKingSide, BlackQueenSide);
CastleSet=set of CanStillCastle
CoordSet= set of DisplayCoords
DisplayCoords=(West, North, East, South);
gen_rec = recordan element of the move stack. it's just a move with a score, so it can be sorted by the search functions. */
m : moverec;
score : Integer;
end;
hist_rec = recordan element of the history stack, with the information necessary to take a move back. */
m : moverec;
capture : Integer;
castle : Integer;
ep : Integer;
fifty : Integer;
end;
MoveInfo = record
position : String;
Castling : CastleSet;
OldSquare : Square;
NewSquare : Square;
EnPassant : Square;
end;
moverec = record
b : move_bytes;
end;
move_bytes = recordFrom Tom:
src : Byte;
dst : Byte;
promote : Byte;
bits : Byte;
end;
pBoolean = ^Boolean
pCastleSet= ^CastleSet
pGenRec = ^gen_rec
pieces=(BP,BN,BB,BR,BK,BQ,WP,WN,WB,WR,WQ,WK);
pSquare = ^Square
pThreadPriority= ^TThreadPriority
Square=(None, A8,B8,C8,D8,E8,F8,G8,H8, A7,B7,C7,D7,E7,F7,G7,H7, A6,B6,C6,D6,E6,F6,G6,H6, A5,B5,C5,D5,E5,F5,G5,H5, A4,B4,C4,D4,E4,F4,G4,H4, A3,B3,C3,D3,E3,F3,G3,H3, A2,B2,C2,D2,E2,F2,G2,H2, A1,B1,C1,D1,E1,F1,G1,H1);
TCaptureEvent =procedure(Sender:TObject; oldSq, newSq: Square; CapturedPiece: Char) of object
TMoveEvent =procedure(Sender:TObject; oldSq, newSq: Square) of object
TMoveFunc =function(oldsq, newsq: Square): Boolean of Object
TOneSquareEvent=procedure(Sender:TObject; square: Square) of object
TPromotionEvent=procedure(Sender:TObject; oldSq, newSq: Square;var NewPiece: Char) of object
TThinkEvent =procedure(Sender: TObject; var oldsq,newsq: Square) of object
Constants |
Variables |