File: gameSetup.h

package info (click to toggle)
cgoban 1.9.14-11
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,420 kB
  • ctags: 3,913
  • sloc: ansic: 36,036; sh: 702; makefile: 254
file content (79 lines) | stat: -rw-r--r-- 2,007 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
 * src/lsetup.h, part of Complete Goban (game program)
 * Copyright (C) 1995 William Shubert.
 * See "configure.h.in" for more copyright information.
 */


#ifndef  _GAMESETUP_H_
#define  _GAMESETUP_H_  1

#ifndef  _GOGAME_H_
#include "goGame.h"
#endif
#ifndef  _GOTIME_H_
#include "goTime.h"
#endif


/**********************************************************************
 * Data types
 **********************************************************************/
typedef struct GameSetup_struct  {
  Cgoban  *cg;

  void  (*callback)(void *packet, struct GameSetup_struct *gs);
  void  *packet;

  ButWin  *win;
  But  *bg;
  But  *title;

  But  *namesBox;
  But  *wStr, *wIn;
  But  *bStr, *bIn;

  But  *rulesBox;
  But  *rulesMenu;
  But  *sizeStr, *sizeIn;
  But  *hcapStr, *hcapIn;
  But  *komiStr, *komiIn;
  GoRules  rules;
  int  size, hcap;
  float  komi;
  bool  sizeSet, hcapSet, komiSet;

  But  *timeBox;
  But  *timeMenu;
  But  *mainStr, *mainIn;
  But  *byStr,  *byIn;
  But  *auxStr, *auxIn;
  GoTimeType  timeType;
  int  numTimeArgs, mainTime, byTime, aux;

  But  *help, *ok, *cancel;
  MAGIC_STRUCT
} GameSetup;


/**********************************************************************
 * Functions
 **********************************************************************/
extern GameSetup  *gameSetup_create(Cgoban *cg,
				    void (*callback)(void *packet,
						     GameSetup *gs),
				    void *packet);
extern void  gameSetup_destroy(GameSetup *ls);
#define  gameSetup_rules(gs)     ((gs)->rules)
#define  gameSetup_size(gs)      ((gs)->size)
#define  gameSetup_handicap(gs)  ((gs)->hcap)
#define  gameSetup_komi(gs)      ((gs)->komi)
#define  gameSetup_wName(gs)     (butTextin_get((gs)->wIn))
#define  gameSetup_bName(gs)     (butTextin_get((gs)->bIn))
#define  gameSetup_timeType(gs)  ((gs)->timeType)
#define  gameSetup_mainTime(gs)  ((gs)->mainTime)
#define  gameSetup_byTime(gs)    ((gs)->byTime)
#define  gameSetup_timeAux(gs)   ((gs)->aux)


#endif  /* _GAMESETUP_H_ */