home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 3.ddi / CHESS.ZIP / WCDEFS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  2.9 KB  |  134 lines

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