-rw-r--r-- | noncore/games/go/go.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/noncore/games/go/go.h b/noncore/games/go/go.h new file mode 100644 index 0000000..9aa644b --- a/dev/null +++ b/noncore/games/go/go.h | |||
@@ -0,0 +1,81 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | /* AmiGo Include */ | ||
21 | /* MSG types for getinput() */ | ||
22 | |||
23 | #ifndef __go_h | ||
24 | #define __go_h | ||
25 | |||
26 | |||
27 | #define INTERSECTIONMSG 1/* User buttoned an intersection */ | ||
28 | #define QUITMSG 2 /* User buttoned QUIT icon */ | ||
29 | #define PLAYMSG 3 | ||
30 | #define RESTARTMSG 4 | ||
31 | #define PASSMSG 5 | ||
32 | |||
33 | #define TRUE 1 | ||
34 | #define FALSE 0 | ||
35 | |||
36 | #define MAXGROUPS 100 | ||
37 | |||
38 | #define PLACED 0 | ||
39 | #define REMOVED 1 | ||
40 | |||
41 | #define numPoints 19 | ||
42 | #define maxPoint numPoints - 1 | ||
43 | |||
44 | /*-- definitions used when counting up --*/ | ||
45 | |||
46 | #define CNT_UNDECIDED0 | ||
47 | #define CNT_BLACK_TERR1 | ||
48 | #define CNT_WHITE_TERR2 | ||
49 | #define CNT_NOONE3 | ||
50 | |||
51 | /*-- macro functions --*/ | ||
52 | |||
53 | #define LegalPoint(x,y) (x>=0 && x<=18 && y>=0 && y<=18) | ||
54 | #define ForeachPoint(a,b)for(a=0;a<19;a++) for (b=0;b<19;b++) | ||
55 | |||
56 | enum bVal {BLACK, WHITE, EMPTY}; | ||
57 | typedef enum bVal sType; | ||
58 | struct Group | ||
59 | { | ||
60 | enum bVal color;/* The color of the group */ | ||
61 | short code, /* The code used to mark stones in the group */ | ||
62 | count, /* The number of stones in the group */ | ||
63 | internal,/* The number of internal liberties */ | ||
64 | external,/* The number of external liberties */ | ||
65 | liberties,/* The total number of liberties */ | ||
66 | eyes, /* The number of eyes */ | ||
67 | alive, /* A judgement of how alive this group is */ | ||
68 | territory;/* The territory this group controls */ | ||
69 | }; | ||
70 | |||
71 | struct bRec | ||
72 | { | ||
73 | enum bVal Val;/* What is at this intersection */ | ||
74 | short xOfs, | ||
75 | yOfs; | ||
76 | short mNum; | ||
77 | short GroupNum;/* What group the stone belongs to */ | ||
78 | short marked;/* TRUE or FALSE */ | ||
79 | }; | ||
80 | |||
81 | #endif | ||