1 /* 2 * src/client/match.h, part of Complete Goban (player program) 3 * Copyright (C) 1996 William Shubert. 4 * See "configure.h.in" for more copyright information. 5 */ 6 7 8 #ifndef _CLIENT_MATCH_H_ 9 10 #ifndef _CLIENT_DATA_H_ 11 #include "data.h" 12 #endif 13 14 #define _CLIENT_MATCH_H_ 1 15 16 17 /********************************************************************** 18 * Data Types 19 **********************************************************************/ 20 typedef struct CliMatch_struct CliMatch; 21 22 typedef enum { 23 cliMatch_nil, cliMatch_sent, cliMatch_recvd 24 } CliMatchState; 25 26 struct CliMatch_struct { 27 CliMatch *next, **prev; 28 CliData *data; 29 30 CliMatchState state; 31 ButWin *win; 32 But *bg; 33 But *title; 34 35 But *namesBox; 36 But *wBox, *wTitle; 37 But *bBox, *bTitle; 38 But *swap; 39 40 But *rulesBox; 41 But *sizeStr, *sizeIn, *sizeDown, *sizeUp; 42 But *hcapStr, *hcapIn, *hcapDown, *hcapUp; 43 But *komiStr, *komiIn, *komiDown, *komiUp; 44 int size, hcap; 45 float komi; 46 47 But *timeBox; 48 But *mainStr, *mainIn, *mainDown1, *mainDown5, *mainUp1, *mainUp5; 49 But *byStr, *byIn, *byDown1, *byDown5, *byUp1, *byUp5; 50 But *freeGame, *freeTitle; 51 int mainTime, byTime; 52 53 But *help, *ok, *cancel; 54 55 Str wName, bName; 56 bool meFirst; 57 58 MAGIC_STRUCT 59 }; 60 61 62 /********************************************************************** 63 * Functions 64 **********************************************************************/ 65 extern CliMatch *cliMatch_create(CliData *data, const char *oppName, 66 CliMatch **next, int rankDiff); 67 extern CliMatch *cliMatch_matchCommand(CliData *data, const char *command, 68 CliMatch **next, int rankDiff); 69 extern void cliMatch_declineCommand(CliMatch *match, const char *buf); 70 extern void cliMatch_destroy(CliMatch *match); 71 /* 72 * If oppName is non-NULL, then destroyChain will fill in hcap etc. with 73 * the game results if it finds the appropriate match form. 74 * It returns TRUE if it does find the right form, FALSE otherwise. 75 */ 76 extern bool cliMatch_destroyChain(CliMatch *match, 77 const char *oppName, int *hcap, 78 float *komi, bool *free); 79 extern void cliMatch_extraInfo(CliMatch *match, 80 const char *oppName, int hcap, 81 float komi, bool free); 82 83 #endif /* _CLIENT_MATCH_H_ */ 84