home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / Games / NeXTGo-3.0-MIS / Board.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-13  |  4.0 KB  |  185 lines

  1. #include "comment.header"
  2.  
  3. /* $Id: Board.h,v 1.4 1997/11/04 16:49:19 ergo Exp $ */
  4.  
  5. /*
  6.  * $Log: Board.h,v $
  7.  * Revision 1.4  1997/11/04 16:49:19  ergo
  8.  * ported to OpenStep
  9.  *
  10.  * Revision 1.3  1997/07/06 19:38:19  ergo
  11.  * actual version
  12.  *
  13.  * Revision 1.3  1997/05/04 18:57:16  ergo
  14.  * added time control for moves
  15.  *
  16.  */
  17.  
  18. #import <AppKit/NSView.h>
  19. #import <SoundKit/Sound.h>
  20. #import <AppKit/dpsOpenStep.h>
  21. #import <AppKit/NSDPSContext.h>
  22. #include "history.h"
  23.  
  24. // Maximum number of tiles in the playing area...
  25.   
  26. #define WHITESTONE    1     
  27. #define BLACKSTONE    2
  28.   
  29. extern unsigned char p[19][19];
  30. extern unsigned char patternmat[19][19], scoringmat[19][19], ownermat[19][19];
  31. extern unsigned char tempmat[19][19], newpatternmat[19][19], mark[19][19];
  32. extern char special_characters[19][19];
  33. extern int hist[19][19], currentMoveNumber;
  34. extern int rd, bothSides, neitherSide, MAXX, MAXY;
  35. extern int opn[9], blackCaptured, whiteCaptured, handicap;
  36. extern int currentStone, opposingStone, blackPassed, whitePassed;
  37. extern int blackTerritory, whiteTerritory, manScoreTemp, SmartGoGameFlag;
  38. extern BOOL AGAScoring, manualScoring, typeOfScoring, gameType;
  39. extern float black_Score, white_Score;
  40. extern gameHistory gameMoves[500];
  41. extern int lastMove;
  42. extern BOOL finished, blackSide, whiteSide;
  43. extern BOOL scoringGame, resultsDisplayed;
  44. typedef struct {
  45.     id timeToHandle;    // display of black or white time
  46.     int time;
  47.     int byo;
  48.     } TimeStruct;  
  49.     
  50.  
  51.  
  52. @interface GoView:NSView 
  53. {
  54.   
  55.   BOOL gameRunning, gameScored;
  56.     NSImage     *backGround; 
  57.  
  58.     id     blackStone, 
  59.           whiteStone, 
  60.         grayStone, 
  61.         gameMessage, 
  62.         blacksPrisoners, 
  63.         whitesPrisoners, 
  64.         gameMessage2, 
  65.         startButton, 
  66.         stopButton, 
  67.         passButton, 
  68.         mainMenu, 
  69.         upperLeft, 
  70.         upperRight, 
  71.         lowerLeft, 
  72.         lowerRight, 
  73.         midLeft, 
  74.         midRight, 
  75.         midTop, 
  76.         midBottom, 
  77.         innerSquare, 
  78.         innerHandicap;
  79.     id     BlackTerrValue, 
  80.         BlackTerrString, 
  81.         BlackPrisonValue, 
  82.         BlackPrisonString, 
  83.         BlackTotalValue, 
  84.         WhiteTerrValue, 
  85.         WhiteTerrString, 
  86.         WhitePrisonValue, 
  87.         WhitePrisonString, 
  88.         WhiteTotalValue, 
  89.         GameResult, 
  90.         KomiValue, 
  91.         TypeOfScoring, 
  92.         ScoringWindow;
  93.     id    showHistFlag, 
  94.         historyFont, 
  95.         blackTerrFont, 
  96.         whiteTerrFont, 
  97.         stoneClick, 
  98.         showCoords, 
  99.         playSounds, 
  100.         blackTime, 
  101.         whiteTime, 
  102.         IGSGameNumber, 
  103.         IGSBlackPlayer, 
  104.         IGSWhitePlayer, 
  105.         IGShandicap, 
  106.         IGSkomi;
  107.     id    ControlPanel;
  108.         
  109.     int bTime, bByo, wTime, wByo;
  110.     NSTimer *te;
  111.     long startZeit;
  112.     TimeStruct    ts;
  113.     int ByoTime;        /* time in byo-yomi in minutes     */
  114.     long time;            /* time we received a move         */
  115.   
  116. }
  117.  
  118. /* The following methods can be called by Interface Builder objects &
  119.    during creation/destruction of instances of BreakView.  */
  120.   
  121. - initWithFrame:(NSRect)frm;
  122. - (void)dealloc;
  123.  
  124. - resetButtons;
  125. - startNewGame;
  126. - go:sender;
  127. - (void)stop:(id)sender;
  128. - passMove;
  129. - showLastMove:sender;
  130. - undo;
  131. - undoLastMove:sender;
  132. - toggleShowHistFlag:sender;
  133. - toggleSound:sender;
  134. - doClick;
  135. - toggleCoords:sender;
  136.  
  137. - changeBackground:sender;
  138. - revertBackground:sender;
  139.  
  140. - setMess1:(char *)s;
  141. - setMess2:(char *)s;
  142.  
  143. /* The following methods are internal and probably should not be called
  144.    by others.  */
  145.   
  146. - setBackgroundFile:(const char *)fileName andRemember:(BOOL)remember;
  147. - (void)drawRect:(NSRect)rects;
  148. - drawBackground:(NSRect *)rect;
  149. - showBlackStone;
  150. - showWhiteStone;
  151. - showGrayStone;
  152. - showBackgroundPiece: (int)x: (int)y;
  153. - eraseStone;
  154. - addMoveToGameMoves: (int)color: (int)x: (int)y;
  155. - makeMove: (int)color: (int)x: (int)y;
  156. - makeMoveSilent: (int)color: (int)x: (int)y;
  157. - setGameNumber: (int)n;
  158. - setTimeAndByo: (int)btime: (int)bbyo: (int)wtime: (int)wbyo;
  159. - dispTime;
  160. - setWhiteName: (char *)wname;
  161. - setBlackName: (char *)bname;
  162. - setIGSHandicap: (int)h;
  163. - setIGSKomi: (char *)k;
  164. - setByoTime: (int)aByoTime;
  165. - (int)ByoTime;
  166. - updateInfo;
  167. - refreshIO;
  168. - displayScoringInfo;
  169. - scoreGame;
  170. - step;
  171. - selectMove;
  172. - selectMoveEnd;
  173. - flashStone: (int)x :(int)y;
  174. - setblacksPrisoners:(int)bp;
  175. - setwhitesPrisoners:(int)wp;
  176. - (long)startZeit;
  177. - setStartZeit:(long)aTime;
  178. - (int)bByo;
  179. - (TimeStruct*)ts;
  180. - gameCompleted;
  181. - removeTE;
  182.  
  183. - (void) TEHandler:(NSTimer *)aTimer;
  184. @end
  185.