10 typedef enum parse_code (*engine_notify
)(struct engine
*e
, struct board
*b
, int id
, char *cmd
, char *args
, char **reply
);
11 typedef char *(*engine_notify_play
)(struct engine
*e
, struct board
*b
, struct move
*m
);
12 typedef char *(*engine_undo
)(struct engine
*e
, struct board
*b
);
13 typedef char *(*engine_result
)(struct engine
*e
, struct board
*b
);
14 typedef char *(*engine_chat
)(struct engine
*e
, struct board
*b
, char *cmd
);
15 /* Generate a move. If pass_all_alive is true, <pass> shall be generated only
16 * if all stones on the board can be considered alive, without regard to "dead"
17 * considered stones. */
18 typedef coord_t
*(*engine_genmove
)(struct engine
*e
, struct board
*b
, struct time_info
*ti
, enum stone color
, bool pass_all_alive
);
19 typedef char *(*engine_genmoves
)(struct engine
*e
, struct board
*b
, struct time_info
*ti
, enum stone color
,
20 char *args
, bool pass_all_alive
, void **stats_buf
, int *stats_size
);
21 /* Evaluate feasibility of player @color playing at all free moves. Will
22 * simulate each move from b->f[i] for time @ti, then set
23 * 1-max(opponent_win_likelihood) in vals[i]. */
24 typedef void (*engine_evaluate
)(struct engine
*e
, struct board
*b
, struct time_info
*ti
, floating_t
*vals
, enum stone color
);
25 /* One dead group per queued move (coord_t is (ab)used as group_t). */
26 typedef void (*engine_dead_group_list
)(struct engine
*e
, struct board
*b
, struct move_queue
*mq
);
27 /* e->data and e will be free()d by caller afterwards. */
28 typedef void (*engine_done
)(struct engine
*e
);
30 /* This is engine data structure. A new engine instance is spawned
31 * for each new game during the program lifetime. */
36 /* If set, do not reset the engine state on clear_board. */
40 board_cprint printhook
;
41 engine_notify_play notify_play
;
45 engine_genmove genmove
;
46 engine_genmoves genmoves
;
47 engine_evaluate evaluate
;
48 engine_dead_group_list dead_group_list
;