UCT max_tree_size: Print a notification when memory gets full
[pachi.git] / engine.h
blob864271696ad8aef41ed603db3168d8eb55617439
1 #ifndef ZZGO_ENGINE_H
2 #define ZZGO_ENGINE_H
4 #include "board.h"
5 #include "move.h"
7 /* Used to signal the main loop that the engine structures need to be reset
8 * (for fresh board). */
9 extern bool engine_reset;
11 struct engine;
12 struct move_queue;
14 typedef char *(*engine_notify_play)(struct engine *e, struct board *b, struct move *m);
15 typedef char *(*engine_chat)(struct engine *e, struct board *b, char *cmd);
16 /* Generate a move. If pass_all_alive is true, <pass> shall be generated only
17 * if all stones on the board can be considered alive, without regard to "dead"
18 * considered stones. */
19 typedef coord_t *(*engine_genmove)(struct engine *e, struct board *b, enum stone color, bool pass_all_alive);
20 /* One dead group per queued move (coord_t is (ab)used as group_t). */
21 typedef void (*engine_dead_group_list)(struct engine *e, struct board *b, struct move_queue *mq);
22 /* e->data and e will be free()d by caller afterwards. */
23 typedef void (*engine_done)(struct engine *e);
25 /* This is engine data structure. A new engine instance is spawned
26 * for each new game during the program lifetime. */
27 struct engine {
28 char *name;
29 char *comment;
31 /* If set, do not reset the engine state on clear_board. */
32 bool keep_on_clear;
34 board_cprint printhook;
35 engine_notify_play notify_play;
36 engine_chat chat;
37 engine_genmove genmove;
38 engine_dead_group_list dead_group_list;
39 engine_done done;
40 void *data;
43 #endif