Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.6 KiB

  1. /* Type def's needed if your using the card DLL */
  2. typedef enum { faceup = 0,
  3. facedown = 1,
  4. hilite = 2,
  5. ghost = 3,
  6. remove = 4
  7. } cardMode;
  8. typedef enum { club = 0,
  9. diamond = 1,
  10. heart = 2,
  11. spade = 3
  12. } cardSuit;
  13. typedef enum { ace = 0,
  14. two = 1,
  15. three = 2,
  16. four = 3,
  17. five = 4,
  18. six = 5,
  19. seven = 6,
  20. eight = 7,
  21. nine = 8,
  22. ten = 9,
  23. jack = 10,
  24. queen = 11,
  25. king = 12
  26. } cardRank;
  27. /* Commonly needed macros for card games. */
  28. #define CardIndex(suit, rank) ((rank) << 2 + (suit))
  29. #define CardSuit(index) ((index) & 3)
  30. #define CardRank(index) ((index) >> 2)
  31. #define SameSuit(index1, index2) (CardSuit((index1)) == CardSuit((index2)))
  32. #define SameRank(index1, index2) (CardRank((index1)) == CardRank((index2)))
  33. #define ACELOW 13
  34. #define ACEHIGH 14
  35. #define IndexValue(index, acerank) (CardRank(index) % (acerank))
  36. //-protect-#define RanksHigher(index1, index2, acerank)
  37. // (IndexValue((index1), (acerank)) > IndexValue((index2), (acerank)))
  38. /* Function prototypes for API resolved in the cards DLL */
  39. BOOL APIENTRY cdtInit(INT FAR *width, INT FAR *height);
  40. BOOL APIENTRY cdtDraw(HDC hDC, INT x, INT y,
  41. INT crd, cardMode mode, DWORD rgbBgnd);
  42. BOOL APIENTRY cdtTerm(VOID);
  43.