home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / Delphi / CheesboardComponent / chessbrd.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-13  |  19.7 KB  |  522 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'ChessBrd.pas' rev: 3.00
  6.  
  7. #ifndef ChessBrdHPP
  8. #define ChessBrdHPP
  9. #include <ExtCtrls.hpp>
  10. #include <Grids.hpp>
  11. #include <Dialogs.hpp>
  12. #include <Forms.hpp>
  13. #include <Controls.hpp>
  14. #include <Graphics.hpp>
  15. #include <Classes.hpp>
  16. #include <SysUtils.hpp>
  17. #include <Messages.hpp>
  18. #include <Windows.hpp>
  19. #include <SysInit.hpp>
  20. #include <System.hpp>
  21.  
  22. //-- user supplied -----------------------------------------------------------
  23.  
  24. namespace Chessbrd
  25. {
  26. //-- type declarations -------------------------------------------------------
  27. class DELPHICLASS EChessException;
  28. class PASCALIMPLEMENTATION EChessException : public Sysutils::Exception 
  29. {
  30.     typedef Sysutils::Exception inherited;
  31.     
  32. public:
  33.     /* Exception.Create */ __fastcall EChessException(const System::AnsiString Msg) : Sysutils::Exception(
  34.         Msg) { }
  35.     /* Exception.CreateFmt */ __fastcall EChessException(const System::AnsiString Msg, const System::TVarRec 
  36.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  37.     /* Exception.CreateRes */ __fastcall EChessException(int Ident, Extended Dummy) : Sysutils::Exception(
  38.         Ident, Dummy) { }
  39.     /* Exception.CreateResFmt */ __fastcall EChessException(int Ident, const System::TVarRec * Args, const 
  40.         int Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  41.     /* Exception.CreateHelp */ __fastcall EChessException(const System::AnsiString Msg, int AHelpContext
  42.         ) : Sysutils::Exception(Msg, AHelpContext) { }
  43.     /* Exception.CreateFmtHelp */ __fastcall EChessException(const System::AnsiString Msg, const System::TVarRec 
  44.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  45.         ) { }
  46.     /* Exception.CreateResHelp */ __fastcall EChessException(int Ident, int AHelpContext) : Sysutils::Exception(
  47.         Ident, AHelpContext) { }
  48.     /* Exception.CreateResFmtHelp */ __fastcall EChessException(int Ident, const System::TVarRec * Args
  49.         , const int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext
  50.         ) { }
  51.     
  52. public:
  53.     /* TObject.Destroy */ __fastcall virtual ~EChessException(void) { }
  54.     
  55. };
  56.  
  57. enum Square { None, A8, B8, C8, D8, E8, F8, G8, H8, A7, B7, C7, D7, E7, F7, G7, H7, A6, B6, C6, D6, 
  58.     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, 
  59.     F3, G3, H3, A2, B2, C2, D2, E2, F2, G2, H2, A1, B1, C1, D1, E1, F1, G1, H1 };
  60.  
  61. enum DisplayCoords { West, North, East, South };
  62.  
  63. enum CanStillCastle { WhiteKingSide, WhiteQueenSide, BlackKingSide, BlackQueenSide };
  64.  
  65. typedef Set<CanStillCastle, WhiteKingSide, BlackQueenSide>  CastleSet;
  66.  
  67. typedef Set<DisplayCoords, West, South>  CoordSet;
  68.  
  69. struct MoveInfo
  70. {
  71.     System::AnsiString position;
  72.     CastleSet Castling;
  73.     Square OldSquare;
  74.     Square NewSquare;
  75.     Square EnPassant;
  76. } ;
  77.  
  78. enum pieces { BP, BN, BB, BR, BK, BQ, WP, WN, WB, WR, WQ, WK };
  79.  
  80. struct gen_rec;
  81. typedef gen_rec *pGenRec;
  82.  
  83. typedef Square *pSquare;
  84.  
  85. typedef CastleSet *pCastleSet;
  86.  
  87. typedef bool *pBoolean;
  88.  
  89. typedef Classes::TThreadPriority *pThreadPriority;
  90.  
  91. typedef void __fastcall (__closure *TMoveEvent)(System::TObject* Sender, Square oldSq, Square newSq)
  92.     ;
  93.  
  94. typedef void __fastcall (__closure *TCaptureEvent)(System::TObject* Sender, Square oldSq, Square newSq
  95.     , char CapturedPiece);
  96.  
  97. typedef void __fastcall (__closure *TOneSquareEvent)(System::TObject* Sender, Square square);
  98.  
  99. typedef void __fastcall (__closure *TPromotionEvent)(System::TObject* Sender, Square oldSq, Square newSq
  100.     , char &NewPiece);
  101.  
  102. typedef bool __fastcall (__closure *TMoveFunc)(Square oldsq, Square newsq);
  103.  
  104. typedef void __fastcall (__closure *TThinkEvent)(System::TObject* Sender, Square &oldsq, Square &newsq
  105.     );
  106.  
  107. #pragma pack(push, 1)
  108. struct move_bytes
  109. {
  110.     Byte src;
  111.     Byte dst;
  112.     Byte promote;
  113.     Byte bits;
  114. } ;
  115. #pragma pack(pop)
  116.  
  117. #pragma pack(push, 1)
  118. struct moverec
  119. {
  120.     move_bytes b;
  121. } ;
  122. #pragma pack(pop)
  123.  
  124. struct gen_rec
  125. {
  126.     moverec m;
  127.     int score;
  128. } ;
  129.  
  130. struct hist_rec
  131. {
  132.     moverec m;
  133.     int capture;
  134.     int castle;
  135.     int ep;
  136.     int fifty;
  137. } ;
  138.  
  139. class DELPHICLASS TChessThread;
  140. class PASCALIMPLEMENTATION TChessThread : public Classes::TThread 
  141. {
  142.     typedef Classes::TThread inherited;
  143.     
  144. private:
  145.     int pcsq[2][6][64];
  146.     int flip[64];
  147.     int pawn_pcsq[64];
  148.     int kingside_pawn_pcsq[64];
  149.     int queenside_pawn_pcsq[64];
  150.     int minor_pcsq[64];
  151.     int king_pcsq[64];
  152.     int endgame_king_pcsq[64];
  153.     int color[64];
  154.     int piece[64];
  155.     int side;
  156.     int xside;
  157.     int castle;
  158.     int ep;
  159.     int fifty;
  160.     int ply;
  161.     gen_rec gen_dat[4096];
  162.     int gen_begin[64];
  163.     int gen_end[64];
  164.     int history[64][64];
  165.     hist_rec hist_dat[64];
  166.     int nodes;
  167.     moverec pv[64][64];
  168.     int pv_length[64];
  169.     bool follow_pv;
  170.     int mailbox[120];
  171.     int mailbox64[64];
  172.     bool slide[6];
  173.     int offsets[6];
  174.     int offset[6][8];
  175.     int castle_mask[64];
  176.     int value[6];
  177.     char piece_char[6];
  178.     int init_color[64];
  179.     int init_piece[64];
  180.     bool Thinking;
  181.     bool *WhiteToMove;
  182.     bool *ComputerPlaysWhite;
  183.     bool *ComputerPlaysBlack;
  184.     bool StopThinkingNow;
  185.     char *Position;
  186.     Square *EnPassant;
  187.     CastleSet *Castling;
  188.     int *SearchDepth;
  189.     Classes::TThreadPriority *ThinkingPriority;
  190.     int __fastcall eval(void);
  191.     bool __fastcall attack(int sq, int s);
  192.     int __fastcall ColorOfPiece(Square sq);
  193.     bool __fastcall in_check(int s);
  194.     bool __fastcall makemove(move_bytes m);
  195.     int __fastcall quiesce(int alpha, int beta);
  196.     int __fastcall search(int alpha, int beta, int depth);
  197.     void __fastcall ThinkAboutAMove(void);
  198.     void __fastcall ThinkingFinished(void);
  199.     void __fastcall gen(void);
  200.     void __fastcall gen_caps(void);
  201.     void __fastcall gen_promote(int src, int dst, int bits);
  202.     void __fastcall gen_push(int src, int dst, int bits);
  203.     void __fastcall InitValues(void);
  204.     void __fastcall init_eval(void);
  205.     void __fastcall IntCopy(PINT dest, PINT source, int count);
  206.     void __fastcall PerformMove(void);
  207.     void __fastcall sort(int src);
  208.     void __fastcall sort_pv(void);
  209.     void __fastcall takeback(void);
  210.     
  211. protected:
  212.     virtual void __fastcall Execute(void);
  213.     
  214. public:
  215.     TMoveFunc MoveFunc;
  216.     Classes::TNotifyEvent EndFunc;
  217.     __fastcall TChessThread(void);
  218. public:
  219.     /* TThread.Destroy */ __fastcall virtual ~TChessThread(void) { }
  220.     
  221. };
  222.  
  223. typedef MoveInfo ChessBrd__4[257][3];
  224.  
  225. class DELPHICLASS TChessBrd;
  226. class PASCALIMPLEMENTATION TChessBrd : public Controls::TGraphicControl 
  227. {
  228.     typedef Controls::TGraphicControl inherited;
  229.     
  230. private:
  231.     Extctrls::TTimer* timer;
  232.     MoveInfo temp;
  233.     Controls::TCursor OldCursor;
  234.     TChessThread* Now;
  235.     bool GameEnded;
  236.     bool FirstTime;
  237.     MoveInfo MoveList[257][3];
  238.     char buf[261];
  239.     char PromoteTo;
  240.     int PieceIndex[3][7];
  241.     int Boardx;
  242.     int Boardy;
  243.     int PieceSize;
  244.     int _SizeOfSquare;
  245.     int _CurrentMove;
  246.     bool ResizeState;
  247.     bool _resizable;
  248.     int _ResizeMinSize;
  249.     int _ResizeMaxSize;
  250.     bool _ComputerPlaysWhite;
  251.     bool _ComputerPlaysBlack;
  252.     int _SearchDepth;
  253.     TThreadPriority _ThinkingPriority;
  254.     TMoveEvent _legalMove;
  255.     TMoveEvent _check;
  256.     TMoveEvent _mate;
  257.     TMoveEvent _staleMate;
  258.     TMoveEvent _castle;
  259.     TMoveEvent _failed;
  260.     Classes::TNotifyEvent _paint;
  261.     Classes::TNotifyEvent _draw;
  262.     Classes::TNotifyEvent _noMatingMaterial;
  263.     Classes::TNotifyEvent _threefoldPosition;
  264.     TThinkEvent _calculate;
  265.     TCaptureEvent _capture;
  266.     TOneSquareEvent _illegalMove;
  267.     TPromotionEvent _promotion;
  268.     Square _enPassant;
  269.     char _position[66];
  270.     Controls::TImageList* list;
  271.     Graphics::TBitmap* _squareLight;
  272.     Graphics::TBitmap* _squareDark;
  273.     Graphics::TBitmap* _borderBitmap;
  274.     Graphics::TBitmap* _custompieceset;
  275.     Graphics::TBitmap* Default;
  276.     Graphics::TPen* _lineStyle;
  277.     Graphics::TFont* _coordFont;
  278.     CastleSet _castlingAllowed;
  279.     CoordSet _displayCoords;
  280.     bool _customEngine;
  281.     Square SquareClick1;
  282.     Square SquareClick2;
  283.     int _SizeOfBorder;
  284.     int _animationDelay;
  285.     bool _whiteOnTop;
  286.     bool _whiteToMove;
  287.     bool _boardlines;
  288.     bool _animateMoves;
  289.     Graphics::TColor _squareColorLight;
  290.     Graphics::TColor _squareColorDark;
  291.     Graphics::TColor _bordercolor;
  292.     System::AnsiString _version;
  293.     void __fastcall TimerCallback(System::TObject* Sender);
  294.     bool __fastcall CheckLegalBishopMove(Square oldsq, Square newsq);
  295.     bool __fastcall CheckLegalKingMove(Square oldsq, Square newsq);
  296.     bool __fastcall CheckLegalKnightMove(Square oldsq, Square newsq);
  297.     bool __fastcall CheckLegalPawnMove(Square oldsq, Square newsq);
  298.     bool __fastcall CheckLegalRookMove(Square oldsq, Square newsq);
  299.     bool __fastcall CheckLegalQueenMove(Square oldsq, Square newsq);
  300.     bool __fastcall BitmapExists(Graphics::TBitmap* bmp);
  301.     bool __fastcall BitmapIsValidPieceSet(Graphics::TBitmap* bmp);
  302.     bool __fastcall CheckForThreefoldPosition(void);
  303.     int __fastcall PieceToInt(char piece);
  304.     void __fastcall DoPromotion(Square sq);
  305.     void __fastcall ThinkingComplete(System::TObject* Sender);
  306.     void __fastcall DrawBorder(void);
  307.     void __fastcall DrawBoard(void);
  308.     void __fastcall DrawBoardLines(void);
  309.     void __fastcall DrawPieces(void);
  310.     void __fastcall DrawPiece(Square sq, char piece);
  311.     void __fastcall InitializeBitmap(void);
  312.     void __fastcall OrganizeBitmaps(void);
  313.     void __fastcall AnimateHorizontally(int x1, int x2, int y, int delay);
  314.     void __fastcall AnimateVertically(int y1, int y2, int x, int delay);
  315.     void __fastcall AnimateDiagonally(int x1, int y1, int x2, int y2, int delay);
  316.     void __fastcall SetNewGame(void);
  317.     System::AnsiString __fastcall Get_Position();
  318.     bool __fastcall Get_Thinking(void);
  319.     void __fastcall Set_BoardLines(bool show);
  320.     void __fastcall Set_BorderBitmap(Graphics::TBitmap* bmp);
  321.     void __fastcall Set_BorderColor(Graphics::TColor c);
  322.     void __fastcall Set_ComputerPlaysBlack(bool plays);
  323.     void __fastcall Set_ComputerPlaysWhite(bool plays);
  324.     void __fastcall Set_CoordFont(Graphics::TFont* f);
  325.     void __fastcall Set_CurrentMove(int moveno);
  326.     void __fastcall Set_CustomPieceSet(Graphics::TBitmap* bmp);
  327.     void __fastcall Set_CustomEngine(bool use);
  328.     void __fastcall Set_DarkSquare(Graphics::TBitmap* bmp);
  329.     void __fastcall Set_DisplayCoords(CoordSet cset);
  330.     void __fastcall Set_EnPassant(Square sq);
  331.     void __fastcall Set_LightSquare(Graphics::TBitmap* bmp);
  332.     void __fastcall Set_LineStyle(Graphics::TPen* pen);
  333.     void __fastcall Set_Position(System::AnsiString pos);
  334.     void __fastcall Set_ResizeMaxSize(int size);
  335.     void __fastcall Set_ResizeMinSize(int size);
  336.     void __fastcall Set_SearchDepth(int depth);
  337.     void __fastcall Set_SizeOfBorder(int border);
  338.     void __fastcall Set_SizeOfSquare(int size);
  339.     void __fastcall Set_SquareColorDark(Graphics::TColor c);
  340.     void __fastcall Set_SquareColorLight(Graphics::TColor c);
  341.     void __fastcall Set_Thinking(bool thinking);
  342.     void __fastcall Set_ThinkingPriority(Classes::TThreadPriority priority);
  343.     void __fastcall Set_Version(System::AnsiString str);
  344.     void __fastcall Set_WhiteOnTop(bool wabove);
  345.     void __fastcall Set_WhiteToMove(bool wmove);
  346.     
  347. protected:
  348.     DYNAMIC void __fastcall Click(void);
  349.     DYNAMIC void __fastcall DragCanceled(void);
  350.     DYNAMIC void __fastcall DragDrop(System::TObject* Source, int X, int Y);
  351.     DYNAMIC void __fastcall DragOver(System::TObject* Source, int X, int Y, Controls::TDragState State, 
  352.         bool &Accept);
  353.     HIDESBASE void __fastcall EndDrag(bool drop);
  354.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  355.         int Y);
  356.     DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
  357.     DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int 
  358.         Y);
  359.     virtual void __fastcall Paint(void);
  360.     void __fastcall Promotion(System::TObject* Sender, Square oldSq, Square newSq, char &NewPiece);
  361.     virtual void __fastcall WndProc(Messages::TMessage &Message);
  362.     
  363. public:
  364.     int FirstMove;
  365.     int LastMove;
  366.     bool FirstTurn;
  367.     bool LastTurn;
  368.     __fastcall virtual TChessBrd(Classes::TComponent* AOwner);
  369.     __fastcall virtual ~TChessBrd(void);
  370.     bool __fastcall BlackInCheckAfter(Square oldsq, Square newsq);
  371.     int __fastcall ColorOfPiece(char piece);
  372.     int __fastcall ColorOfPieceOnSquare(Square sq);
  373.     int __fastcall ColorOfSquare(Square sq);
  374.     MoveInfo __fastcall GetMove(int moveno, bool whiteMoves);
  375.     bool __fastcall GotoMove(int moveno, bool whiteMoves);
  376.     bool __fastcall LegalMoveAvailable(void);
  377.     Square __fastcall MouseToSquare(int x, int y);
  378.     bool __fastcall Move(Square oldsq, Square newsq);
  379.     bool __fastcall MoveBackward(void);
  380.     bool __fastcall MoveForward(void);
  381.     bool __fastcall MoveIsLegal(Square oldsq, Square newsq);
  382.     bool __fastcall PerformMove(Square oldsq, Square newsq);
  383.     bool __fastcall SetUpPosition(const MoveInfo &pos, int moveno, bool whiteMoves);
  384.     Square __fastcall StringToSquare(System::AnsiString str);
  385.     bool __fastcall WhiteInCheckAfter(Square oldsq, Square newsq);
  386.     Square __fastcall WindowToSquare(int x, int y);
  387.     int __fastcall XPos(Square sq);
  388.     int __fastcall YPos(Square sq);
  389.     void __fastcall Animate(Square oldsq, Square newsq, int delay);
  390.     void __fastcall CancelThinking(void);
  391.     void __fastcall ClearSquare(Square sq);
  392.     void __fastcall DrawChessPiece(Graphics::TCanvas* canvas, int x, int y, char piece);
  393.     void __fastcall GetMoveList(Classes::TStringList* &list);
  394.     void __fastcall NewGame(void);
  395.     void __fastcall SquareToCoords(Square sq, int &x, int &y);
  396.     void __fastcall Think(void);
  397.     void __fastcall UpdateChessBoard(System::AnsiString oldpos);
  398.     
  399. __published:
  400.     __property bool AnimateMoves = {read=_animateMoves, write=_animateMoves, nodefault};
  401.     __property int AnimationDelay = {read=_animationDelay, write=_animationDelay, nodefault};
  402.     __property bool BoardLines = {read=_boardlines, write=Set_BoardLines, nodefault};
  403.     __property Graphics::TBitmap* BorderBitmap = {read=_borderBitmap, write=Set_BorderBitmap};
  404.     __property Graphics::TColor BorderColor = {read=_bordercolor, write=Set_BorderColor, nodefault};
  405.     __property CastleSet CastlingAllowed = {read=_castlingAllowed, write=_castlingAllowed, nodefault};
  406.     __property bool ComputerPlaysBlack = {read=_ComputerPlaysBlack, write=Set_ComputerPlaysBlack, nodefault
  407.         };
  408.     __property bool ComputerPlaysWhite = {read=_ComputerPlaysWhite, write=Set_ComputerPlaysWhite, nodefault
  409.         };
  410.     __property bool Thinking = {read=Get_Thinking, write=Set_Thinking, nodefault};
  411.     __property Graphics::TFont* CoordFont = {read=_coordFont, write=Set_CoordFont};
  412.     __property int CurrentMove = {read=_CurrentMove, write=Set_CurrentMove, nodefault};
  413.     __property Graphics::TBitmap* CustomPieceSet = {read=_custompieceset, write=Set_CustomPieceSet};
  414.     __property CoordSet DisplayCoords = {read=_displayCoords, write=Set_DisplayCoords, nodefault};
  415.     __property bool CustomEngine = {read=_customEngine, write=Set_CustomEngine, nodefault};
  416.     __property Square EnPassant = {read=_enPassant, write=Set_EnPassant, nodefault};
  417.     __property Graphics::TPen* LineStyle = {read=_lineStyle, write=Set_LineStyle};
  418.     __property System::AnsiString Position = {read=Get_Position, write=Set_Position};
  419.     __property bool Resizable = {read=_resizable, write=_resizable, nodefault};
  420.     __property int ResizeMinSize = {read=_ResizeMinSize, write=Set_ResizeMinSize, nodefault};
  421.     __property int ResizeMaxSize = {read=_ResizeMaxSize, write=Set_ResizeMaxSize, nodefault};
  422.     __property int SearchDepth = {read=_SearchDepth, write=Set_SearchDepth, nodefault};
  423.     __property int SizeOfBorder = {read=_SizeOfBorder, write=Set_SizeOfBorder, nodefault};
  424.     __property int SizeOfSquare = {read=_SizeOfSquare, write=Set_SizeOfSquare, nodefault};
  425.     __property Graphics::TColor SquareColorDark = {read=_squareColorDark, write=Set_SquareColorDark, nodefault
  426.         };
  427.     __property Graphics::TColor SquareColorLight = {read=_squareColorLight, write=Set_SquareColorLight, 
  428.         nodefault};
  429.     __property Graphics::TBitmap* SquareDark = {read=_squareDark, write=Set_DarkSquare};
  430.     __property Graphics::TBitmap* SquareLight = {read=_squareLight, write=Set_LightSquare};
  431.     __property bool WhiteOnTop = {read=_whiteOnTop, write=Set_WhiteOnTop, nodefault};
  432.     __property bool WhiteToMove = {read=_whiteToMove, write=Set_WhiteToMove, nodefault};
  433.     __property Classes::TThreadPriority ThinkingPriority = {read=_ThinkingPriority, write=Set_ThinkingPriority
  434.         , nodefault};
  435.     __property System::AnsiString Version = {read=_version, write=Set_Version};
  436.     __property DragCursor ;
  437.     __property DragMode ;
  438.     __property Enabled ;
  439.     __property Visible ;
  440.     __property TCaptureEvent OnCapture = {read=_capture, write=_capture};
  441.     __property TMoveEvent OnCastle = {read=_castle, write=_castle};
  442.     __property TMoveEvent OnCheck = {read=_check, write=_check};
  443.     __property Classes::TNotifyEvent OnDraw = {read=_draw, write=_draw};
  444.     __property TOneSquareEvent OnIllegalMove = {read=_illegalMove, write=_illegalMove};
  445.     __property TMoveEvent OnLegalMove = {read=_legalMove, write=_legalMove};
  446.     __property TMoveEvent OnMate = {read=_mate, write=_mate};
  447.     __property Classes::TNotifyEvent OnNoMatingMaterial = {read=_noMatingMaterial, write=_noMatingMaterial
  448.         };
  449.     __property Classes::TNotifyEvent OnPaint = {read=_paint, write=_paint};
  450.     __property TPromotionEvent OnPromotion = {read=_promotion, write=_promotion};
  451.     __property TMoveEvent OnStaleMate = {read=_staleMate, write=_staleMate};
  452.     __property TThinkEvent OnCalculateMove = {read=_calculate, write=_calculate};
  453.     __property TMoveEvent OnCalculationFailed = {read=_failed, write=_failed};
  454.     __property Classes::TNotifyEvent OnThreefoldPosition = {read=_threefoldPosition, write=_threefoldPosition
  455.         };
  456.     __property OnClick ;
  457.     __property OnDblClick ;
  458.     __property OnDragDrop ;
  459.     __property OnDragOver ;
  460.     __property OnEndDrag ;
  461.     __property OnMouseDown ;
  462.     __property OnMouseMove ;
  463.     __property OnMouseUp ;
  464.     __property OnStartDrag ;
  465. };
  466.  
  467. class DELPHICLASS ChessBrdError;
  468. class PASCALIMPLEMENTATION ChessBrdError : public Sysutils::Exception 
  469. {
  470.     typedef Sysutils::Exception inherited;
  471.     
  472. public:
  473.     /* Exception.Create */ __fastcall ChessBrdError(const System::AnsiString Msg) : Sysutils::Exception(
  474.         Msg) { }
  475.     /* Exception.CreateFmt */ __fastcall ChessBrdError(const System::AnsiString Msg, const System::TVarRec 
  476.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  477.     /* Exception.CreateRes */ __fastcall ChessBrdError(int Ident, Extended Dummy) : Sysutils::Exception(
  478.         Ident, Dummy) { }
  479.     /* Exception.CreateResFmt */ __fastcall ChessBrdError(int Ident, const System::TVarRec * Args, const 
  480.         int Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  481.     /* Exception.CreateHelp */ __fastcall ChessBrdError(const System::AnsiString Msg, int AHelpContext)
  482.          : Sysutils::Exception(Msg, AHelpContext) { }
  483.     /* Exception.CreateFmtHelp */ __fastcall ChessBrdError(const System::AnsiString Msg, const System::TVarRec 
  484.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  485.         ) { }
  486.     /* Exception.CreateResHelp */ __fastcall ChessBrdError(int Ident, int AHelpContext) : Sysutils::Exception(
  487.         Ident, AHelpContext) { }
  488.     /* Exception.CreateResFmtHelp */ __fastcall ChessBrdError(int Ident, const System::TVarRec * Args, 
  489.         const int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext)
  490.          { }
  491.     
  492. public:
  493.     /* TObject.Destroy */ __fastcall virtual ~ChessBrdError(void) { }
  494.     
  495. };
  496.  
  497. //-- var, const, procedure ---------------------------------------------------
  498. #define SetAndrew40Str "SETANDREW40"
  499. #define versionStr "3.02"
  500. #define NoPiece (Shortint)(-1)
  501. #define Black (Byte)(0)
  502. #define White (Byte)(1)
  503. #define MOVE_STACK (Word)(4096)
  504. #define HIST_STACK (Byte)(64)
  505. #define LIGHT (Byte)(0)
  506. #define DARK (Byte)(1)
  507. #define PAWN (Byte)(0)
  508. #define KNIGHT (Byte)(1)
  509. #define BISHOP (Byte)(2)
  510. #define ROOK (Byte)(3)
  511. #define QUEEN (Byte)(4)
  512. #define KING (Byte)(5)
  513. #define EMPTY (Byte)(6)
  514. extern PACKAGE void __fastcall Register(void);
  515.  
  516. }    /* namespace Chessbrd */
  517. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  518. using namespace Chessbrd;
  519. #endif
  520. //-- end unit ----------------------------------------------------------------
  521. #endif    // ChessBrd
  522.