~ubuntu-branches/debian/lenny/ggz-server/lenny

« back to all changes in this revision

Viewing changes to game_servers/chess/ai-gnuchess.h

  • Committer: Bazaar Package Importer
  • Author(s): Neil Williams
  • Date: 2008-08-30 22:28:31 UTC
  • mfrom: (3.1.5 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080830222831-lt2l462usl5opxfd
Tags: 0.0.14.1-1.2
* Non-maintainer upload.
* Improve the database.m4 fix to migrate to libdb4.6
  instead of 4.4 {request from Steve Langasek.}

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Chess game module for Guru
 
3
 * Variant: Interface for GNU Chess/XBoard AI
 
4
 * Copyright (C) 2004 - 2006 Josef Spillner, josef@ggzgamingzone.org
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
 */
 
20
 
 
21
#ifndef AI_GNUCHESS_H
 
22
#define AI_GNUCHESS_H
 
23
 
 
24
/* Figure colors */
 
25
#define C_NONE 0
 
26
#define C_WHITE 1
 
27
#define C_BLACK 2
 
28
 
 
29
/* Sets up a chess board in an (0-64) array */
 
30
/* The color is the one the player is using */
 
31
void gnuchess_ai_init(int color, int depth);
 
32
 
 
33
/* Move a figure on the chess board */
 
34
/* Returns 1 on success, 0 on invalid move */
 
35
int gnuchess_ai_move(int from, int to, int force);
 
36
 
 
37
/* Finds a move */
 
38
/* Returns 1 if found, 0 if not found */
 
39
int gnuchess_ai_find(int color, int *from, int *to);
 
40
 
 
41
/* Outputs the board to the console */
 
42
void gnuchess_ai_output(void);
 
43
 
 
44
/* Rochade */
 
45
/* Returns 1 if legal, 0 if not */
 
46
int gnuchess_ai_rochade(int color, int which);
 
47
 
 
48
/* Pawn exchange */
 
49
/* Returns 1 if successful, 0 if not */
 
50
int gnuchess_ai_exchange(int pos, int *figure);
 
51
 
 
52
/* Checkmate or stalemate (draw) */
 
53
/* Returns 1 on checkmate, 0 for game continuation */
 
54
int gnuchess_ai_checkmate(void);
 
55
 
 
56
/* GNU Chess/XBoard interface */
 
57
int gnuchess_launch(void);
 
58
int gnuchess_check(void);
 
59
void gnuchess_shutdown(void);
 
60
 
 
61
#endif
 
62