(Temporarily) set "animate" to "none" by default (broken feature).
[gf1.git] / ai_gipf.h
blob878b6ac35cefd09030fb07b6c476cfe9fb3301d7
1 /*
2 ** $Id$
3 **
4 ** subclass of ai_player for a computer GIPF player
5 */
6 /*
7 ** Copyright (C) 1998 Kurt Van den Branden
8 **
9 ** This program is free software; you can redistribute it and/or modify
10 ** it under the terms of the GNU General Public License as published by
11 ** the Free Software Foundation; either version 2 of the License, or
12 ** (at your option) any later version.
13 **
14 ** This program is distributed in the hope that it will be useful,
15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ** GNU General Public License for more details.
18 **
19 ** You should have received a copy of the GNU General Public License
20 ** along with this program; if not, write to the Free Software
21 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include <vector>
25 #include <deque>
26 #include "ai_player.h"
27 #include "board.h"
29 class ai_gipf : public ai_player {
30 private:
31 char colour;
32 int game;
33 int remoppgipf;
34 int maxgipf;
35 int randomfirstmove;
36 vector<basemove *> * movelist;
38 int evalfunc (void * game, int maxplayer);
39 void listfunc (void * game, vector<basemove *> &);
40 void * newfunc (void * game, basemove * move, int * finished,
41 int * depthdelta, int * nodetype);
42 #if 0
43 void * copymovefunc (void * move);
44 void delmovefunc (void * move);
45 #endif
46 void delgamefunc (void * game);
47 int stopfunc (void);
49 void cleanupmovelist (vector<basemove *> * mlist);
51 public:
52 ai_gipf (char playercolour, int gametype);
53 ~ai_gipf ();
55 void game_move (board * oboard, float timeleft,
56 char * type, char * from, char * to);
57 char game_gipf (board * oboard, float timeleft, char * pos);
58 char game_row (board * oboard, float timeleft, char * start, char * end);
62 enum { // value for the type-field in gipf_move
63 G_MOVE,
64 G_REMGIPF,
65 G_REMROW
69 class gipf_move : public basemove {
70 private:
71 public:
72 gipf_move () {};
73 ~gipf_move ();
75 virtual basemove * copy () ;
77 int type; // G_MOVE, G_REMGIPF or G_REMROW
79 // union {
80 struct {
81 int nr;
82 } piece;
83 struct {
84 char from[3];
85 char to[3];
86 char owner;
87 } remrow;
88 struct {
89 vector<char *> gipflist;
90 // listheader * gipflist; // (items are char-strings)
91 char owner;
92 } remgipf;
93 // };
98 ** C-functions for calling from the main program
100 extern "C" {
101 void * ai_gipf_new (char colour, int game);
102 void ai_gipf_move (board * oboard, void * self, float timeleft,
103 char * type, char * from, char * to);
104 char ai_gipf_gipf (board * oboard, void * self, float timeleft, char * pos);
105 char ai_gipf_row (board * oboard, void * self, float timeleft,
106 char * start, char * end);
107 void ai_gipf_end (void * self);