Sha256: ad7ebf8ed6f16c476d6b300aace0a5885d21e5a4539caa9010ac0f10e383f721

Contents?: true

Size: 871 Bytes

Versions: 2

Compression:

Stored size: 871 Bytes

Contents

/*
 * chess - a fast library to play chess in Ruby
 *
 * Copyright (c) 2011-2012, Enrico Pilotto <enrico@megiston.it>
 * This code is under LICENSE LGPLv3
 */

#ifndef GAME_H
#define GAME_H

#define NEW_GAME (Game*) malloc (sizeof (Game))

#define BUFFER_SIZE 1024

#include "common.h"
#include "board.h"

typedef struct
{
  Board* boards[BUFFER_SIZE];
  char* moves[BUFFER_SIZE];
  char* coord_moves[BUFFER_SIZE];
  int current;
  unsigned short result;
} Game;


#include "special.h"

void init_chess_library ();
Game* init_game ();
void free_game (Game *g);
Board* current_board (Game *g);
Board* get_board (Game *g, int index);
char* current_move (Game *g);
char* current_coord_move (Game *g);
bool apply_move (Game *g, int from, int to, char promote_in);
void rollback (Game *g);
bool threefold_repetition (Game *g);
void set_fen (Game *g, const char *fen);

#endif

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chess-0.1.2 ext/game.h
chess-0.1.1 ext/game.h