home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / CHESS.PAK / WCDEFS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  2.7 KB  |  120 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1991, 1993 by Borland International
  3. //----------------------------------------------------------------------------
  4. #ifndef WCDEFS_H
  5. #define WCDEFS_H
  6.  
  7. //
  8. //  Constants
  9. //
  10. const BACK  =  -104;
  11. const MAXPLY  =  23;
  12. const LOSEVALUE  = 0x7D00;
  13. const MATEVALUE  = 0x7C80;
  14. const DEPTHFACTOR  = 0x80;
  15. const COMMANDLENGTH  = 10;
  16. const MAXLEN         = 64;
  17. const SQUARE_SIZE = 36;
  18. const MAXBDSIZE = 8;
  19. const MYFRAMESIZE = 3;
  20. #define     MAXINT      32767
  21.  
  22. //
  23. //  Typedefs
  24. //
  25. typedef int MAXTYPE;  //  Evaluation type
  26. enum PIECETYPE {empty, king, queen, rook, bishop, knight, pawn};
  27. enum COLORTYPE {white, black};
  28. typedef int INDEXTYPE;
  29. typedef int SQUARETYPE;
  30. typedef int EDGESQUARETYPE;
  31. typedef short DEPTHTYPE;
  32.  
  33. struct MOVETYPE {
  34.   int new1, old;       //  new1 and old square
  35.   short spe;           //  Indicates special move:
  36.                        //    case movepiece of
  37.                        //      king: castling
  38.                        //      pawn: e.p. capture
  39.                        //      else: pawnpromotion
  40.   PIECETYPE movpiece;  // moving piece and
  41.   PIECETYPE content;   // evt. captured piece
  42. };
  43.  
  44. struct BOARDTYPE {
  45.   PIECETYPE piece;
  46.   COLORTYPE color;
  47.   short index;
  48.   unsigned char attacked;
  49. };
  50.  
  51. typedef MOVETYPE LINETYPE[MAXPLY];   //  Principal variation type  
  52. typedef unsigned char *LIBTYPE;      //  The opening library  
  53.  
  54. struct CLOCKTYPE {
  55.   int hour, minute, second, sec100;
  56.   int totalhours, totmin, totalsecs, tots100;
  57.   int number;
  58.   double totaltime;
  59. };
  60.  
  61. typedef char DIRTYPE;
  62. typedef short SETOFPIECE;
  63. enum CASTDIRTYPE {zero, lng, shrt};
  64. typedef CASTDIRTYPE CASTTYPE;
  65. typedef unsigned char FIFTYTYPE;
  66. typedef unsigned char REPEATTYPE;
  67.  
  68. struct NODEVAL {
  69.   unsigned long nodebase, nodeoffset;
  70. };
  71.  
  72. typedef char STR80[81];
  73.  
  74. typedef char COMMANDSTRING[COMMANDLENGTH];
  75.  
  76. enum LEVELTYPE { normal, fullgametime, easygame, infinite, plysearch,
  77.                 matesearch, matching };
  78.  
  79. struct TEXTCOLORTYPE {
  80.   unsigned char background, color;
  81. };
  82.  
  83. struct SCREENPOSTYPE {
  84.   unsigned char x, y;
  85.   unsigned char background, color;
  86. };
  87.  
  88. typedef char STR6[6];
  89.  
  90. typedef struct {
  91.   int x;
  92.   STR6 s;
  93. } PICTURETYPE[3];
  94.  
  95. struct BOARDIDTYPE {
  96.   PIECETYPE piece;
  97.   COLORTYPE color;
  98. };
  99.  
  100. typedef char MAXSTRING[MAXLEN];
  101.  
  102. struct PIECETAB {
  103.   SQUARETYPE isquare;
  104.   PIECETYPE ipiece;
  105. };
  106.  
  107. struct ATTACKTABTYPE {
  108.     //  A set of king..pawn.  gives the pieces, which can move to the
  109.     // *  square
  110.      
  111.   SETOFPIECE pieceset;
  112.   int direction;  //  The direction from the piece to the square  
  113. };
  114.  
  115. struct CASTMOVETYPE {
  116.   SQUARETYPE castnew, castold;
  117. };
  118.  
  119. #endif  // WCDEFS_H
  120.