OpenCores
URL https://opencores.org/ocsvn/connect-6/connect-6/trunk

Subversion Repositories connect-6

[/] [connect-6/] [trunk/] [CONNECTK/] [connectk-2.0/] [src/] [connectk.h] - Blame information for rev 13

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 sumanta.ch
 
2
/*
3
 
4
connectk -- a program to play the connect-k family of games
5
Copyright (C) 2007 Michael Levin
6
 
7
This program is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License
9
as published by the Free Software Foundation; either version 2
10
of the License, or (at your option) any later version.
11
 
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
GNU General Public License for more details.
16
 
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
 
21
*/
22
 
23
/*
24
 *      User Interface
25
 */
26
 
27
#ifdef __GTK_H__
28
void add_tests_to_menu_shell(GtkWidget *menu);
29
#endif
30
 
31
void setup_move(void);
32
void tree_view_clear(unsigned int from);
33
 
34
/*
35
 *      Private game state
36
 */
37
 
38
enum {
39
        SEARCH_NONE,
40
        SEARCH_DFS,
41
        SEARCHES
42
};
43
typedef int SEARCH;
44
 
45
typedef struct {
46
        PLAYER ai;
47
        SEARCH search;
48
        int depth, branch, cache, tss;
49
} Player;
50
 
51
extern int move_last, tournament;
52
extern Player players[PIECES];
53
#define PLAYER_HUMAN 0
54
 
55
void clear_history(unsigned int from_move);
56
void go_to_move(unsigned int move);
57
void make_move(BCOORD x, BCOORD y);
58
void new_game(unsigned int size);
59
void set_board_size(unsigned int size);
60
char *search_to_string(SEARCH s);
61
 
62
/*
63
 *      Move list files
64
 */
65
 
66
int load_moves_list(const char *filename);
67
int save_moves_list(const char *filename);
68
 
69
/*
70
 *      Game board drawing
71
 */
72
 
73
#ifdef __GTK_H__
74
GtkWidget *draw_init(void);
75
#endif
76
void draw_board_sized(int size);
77
#define draw_board() draw_board_sized(0)
78
void draw_tile(BCOORD x, BCOORD y);
79
void draw_playable(int yes);
80
void draw_win(void);
81
void draw_marks(AIMoves *moves, int redraw);
82
void clear_last_moves(void);
83
void draw_last_moves(void);
84
void draw_screenshot(const char *filename);
85
 
86
/*
87
 *      AI players
88
 */
89
 
90
const char *player_to_string(PLAYER player);
91
int number_of_ais(void);
92
AI *ai(int n);
93
AIMoves *run_ai(Player *player);
94
void stop_ai(void);
95
void start_ai(void);
96
void halt_ai_thread(void);
97
void start_ai_thread(void);
98
void search(const Board *b, AIMoves *moves, Player *player);
99
 
100
/*
101
 *      Dialogs
102
 */
103
 
104
#ifdef __GTK_H__
105
typedef struct {
106
        GtkWidget *window, *combo, *search[SEARCHES], *depth, *branch, *cache,
107
                  *tss;
108
        Player *player;
109
} PlayerDialog;
110
 
111
extern PlayerDialog player_dialog[PIECES];
112
 
113
void new_game_dialog_init(void);
114
void open_new_game_dialog(GtkMenuItem *item, gpointer user_data);
115
void open_file_dialog(GtkMenuItem *item, gpointer user_data);
116
void save_file_dialog(GtkMenuItem *item, gpointer user_data);
117
void tourney_dialog_init(void);
118
void tourney_result(PIECE win, int moves);
119
void open_tourney_dialog(GtkWidget *menuitem);
120
void player_dialog_init(PlayerDialog *pd, PIECE player);
121
void open_player_dialog(GtkWidget *menuitem, PlayerDialog *pd);
122
void screenshot_dialog(void);
123
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.