home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 605b.lha / Spades_v2.10 / Source / Globals.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-06  |  4.0 KB  |  131 lines

  1. /*
  2.    FILE: Globals.h
  3.    PURPOSE: Global variables for the Spades program
  4.    AUTHOR: Gregory M. Stelmack
  5. */
  6.  
  7. #ifndef GLOBALS_H
  8. #define GLOBALS_H 1
  9. #endif
  10.  
  11. #ifndef INCLUDE_H
  12. #include "Include.h"
  13. #endif
  14.  
  15. /* Structures needed for libraries */
  16.  
  17. extern struct IntuitionBase *IntuitionBase;
  18. extern struct GfxBase       *GfxBase;
  19. extern struct Library       *DiskfontBase;
  20.  
  21. /* Intuition Structures */
  22.  
  23. extern struct Screen       *CustScr;
  24. extern struct Window       *Wdw;
  25. extern struct Viewport     *WVP;
  26.  
  27. /*************************** Arrays ***************************/
  28.  
  29. /*   Deck: status of cards.            */
  30. /*    0 = Undealt or played.           */
  31. /*    1 thru 4 = Player who holds card.*/
  32.  
  33. extern int Deck[52];
  34.  
  35. /*   Hand: cards in each player's hand. */
  36. /*    0 = Played.                       */
  37. /*    1 thru 52 = Card number.          */
  38.  
  39. extern int Hand[4][13];
  40.  
  41. /*    Bid: number of tricks bid by each player. */
  42.  
  43. extern int Bid[4];
  44.  
  45. /* Mode: aggressiveness of each player.      */
  46. /*    The number in this array is added to   */
  47. /*    the strength of the hand to determine  */
  48. /*    the number of tricks to bid. Higher    */
  49. /*    number equals more tricks.             */
  50.  
  51. extern int Mode[4];
  52.   
  53. /* HighCardLeft: the highest unplayed card   */
  54. /*    in each suit.                          */
  55.  
  56. extern int HighCardLeft[4];
  57.  
  58. /* Card: the card played in a trick by each  */
  59. /*    player.                                */
  60.  
  61. extern int Card[4];
  62.   
  63. /* Value: the point value of each card held     */
  64. /*    in a hand. Used by computer to determine  */
  65. /*    which card to play.                       */
  66.  
  67. extern int Value[13];
  68.  
  69. /* SuitNumber: the number of cards in each   */
  70. /*    suit held by a player.                 */
  71.  
  72. extern int SuitNumber[4];
  73.  
  74. /* CardX & CardY: The X and Y positions for  */
  75. /*    the played card for each player.       */
  76. /* MsgX & MsgY: The X and Y positions for    */
  77. /*    single character messages for each     */
  78. /*    player.                                */
  79.  
  80. extern int CardX[4];
  81. extern int CardY[4];
  82.   
  83. extern int MsgX[4];
  84. extern int MsgY[4];
  85.   
  86. /* OutOfSuit: Whether or not a player is out */
  87. /*    of a suit.                             */
  88.  
  89. extern BOOL OutOfSuit[4][4];
  90.  
  91. /* TricksTaken: How many tricks were won by    */
  92. /*    each player. Used for Nil Bids and Bags. */
  93.  
  94. extern int TricksTaken[4];
  95.  
  96. /* TrickLeader: Who led each trick of the hand */
  97.  
  98. extern int TrickLeader[14];
  99.  
  100. /* CardPlayed: Which card each player played during the hand */
  101.  
  102. extern int CardPlayed[4][13];
  103.  
  104. /******************** Other Global Variables ******************/
  105. extern char *String;          /* Temporary String Storage */
  106.  
  107. extern int PlayerScore;       /* Player's team score */
  108. extern int CompScore;         /* Computer's team score */
  109. extern int PlayerTricks;      /* Number of tricks taken by Player */
  110. extern int CompTricks;        /* Number of tricks taken by Computer */
  111. extern int HandLead;          /* The Dealer for a hand */
  112. extern int Button;            /* Mouse Button pressed */
  113. extern int TrickLead;         /* Who has the lead for a trick */
  114. extern int PlayerBid;         /* Number of tricks bid by Player */
  115. extern int CompBid;           /* Number of tricks bid by Computer */
  116. extern int ShortSuit;         /* A player's short suit */
  117. extern int LongSuit;          /* A player's long suit */
  118. extern int HighCard;          /* The highest card so far in a trick */
  119. extern int Winner;            /* The player who wins a trick so far */
  120. extern int PlayerBags;        /* Number of Bags for Player */
  121. extern int CompBags;          /* Number of Bags for Computer */
  122. extern BOOL SpadePlayed;      /* Was a spade played in this hand yet? */
  123. extern BOOL AllDone;          /* Are we done with the game ? */
  124. extern BOOL ScreenOpen;       /* Was the Spades screen opened yet ? */
  125. extern BOOL BagsRule;         /* Are we playing with Bags ? */
  126. extern BOOL NilRule;          /* Are NIL bids allowed ? */
  127. extern BOOL SaveHand;         /* Save the hand when its over ? */
  128. extern char *CardData;        /* Memory for Card images */
  129.  
  130. extern SHORT Mx,My;           /* Mouse Coordinates */
  131.