home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_10 / 1010108a < prev    next >
Text File  |  1992-08-10  |  856b  |  52 lines

  1. #ifndef GAME_H
  2. #define GAME_H
  3.  
  4. typedef enum { PAWN, BISHOP, ROOK, KING } GAME_PIECE;
  5.  
  6. typedef struct {
  7.     int   vertical;
  8. } PAWN_MOVE_STRUCT;
  9.  
  10. typedef PAWN_MOVE_STRUCT   *PAWN_MOVE;
  11.  
  12. typedef struct {
  13.     int    diagonal;
  14. } BISHOP_MOVE_STRUCT;
  15.  
  16. typedef BISHOP_MOVE_STRUCT   *BISHOP_MOVE;
  17.  
  18. typedef struct {
  19.     int    vertical;
  20.     int    horizontal;
  21. } ROOK_MOVE_STRUCT;
  22.  
  23. typedef ROOK_MOVE_STRUCT   *ROOK_MOVE;
  24.  
  25. typedef struct {
  26.     int    vertical;
  27.     int    horizontal;
  28.     int    diagonal;
  29. } KING_MOVE_STRUCT;
  30.  
  31. typedef KING_MOVE_STRUCT   *KING_MOVE;
  32.  
  33. typedef union {
  34.     PAWN_MOVE      PawnM;
  35.     BISHOP_MOVE    BishopM;
  36.     ROOK_MOVE      RookM;
  37.     KING_MOVE      KingM;
  38. } MOVE_U;
  39.  
  40. typedef MOVE_U          *MOVE;
  41.  
  42. typedef struct {
  43.     GAME_PIECE     piece_type;
  44.     MOVE           moves;
  45.     int            x_coord;
  46.     int            y_coord;
  47. } PIECE_STRUCT;
  48.  
  49. typedef PIECE_STRUCT    *PIECE;
  50.  
  51. #endif /* GAME_H */
  52.