Sha256: 2bae3540c7c0166caabc8a9b938e679d37d02f1b23ff72b2d7516c6cf124a2f0

Contents?: true

Size: 869 Bytes

Versions: 9

Compression:

Stored size: 869 Bytes

Contents

/*
 * chess - a fast library to play chess in Ruby
 *
 * Copyright (c) 2011-2018, Enrico Pilotto <epilotto@gmx.com>
 * 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

9 entries across 9 versions & 1 rubygems

Version Path
chess-0.4.0 ext/chess/game.h
chess-0.3.6 ext/chess/game.h
chess-0.3.5 ext/chess/game.h
chess-0.3.4 ext/chess/game.h
chess-0.3.3 ext/game.h
chess-0.3.2 ext/game.h
chess-0.3.1 ext/game.h
chess-0.3.0 ext/game.h
chess-0.2.2 ext/game.h