Now games can be imported

This commit is contained in:
Loic Guegan 2022-02-26 12:48:52 +01:00
parent e0a1894928
commit b1a82ff568
5 changed files with 38 additions and 7 deletions

View file

@ -1,13 +1,13 @@
#include "Game.hpp"
Game::Game() : current(NULL), moves(NULL) {
Game::Game() : current(NULL), moves(NULL), result("*") {
tags["White"] = "";
tags["Black"] = "";
initial_fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
board = "rnbqkbnrpppppppp PPPPPPPPRNBQKBNR";
}
Game::Game(std::string fen) : current(NULL), moves(NULL) {
Game::Game(std::string fen) : current(NULL), moves(NULL), result("*") {
tags["White"] = "";
tags["Black"] = "";
tags["FEN"] = fen;
@ -15,7 +15,7 @@ Game::Game(std::string fen) : current(NULL), moves(NULL) {
board = chessarbiter::FENParser::Parse(fen).board;
}
Game::Game(HalfMove *m, std::string initial_fen) {
Game::Game(HalfMove *m, std::string initial_fen): result("*") {
moves = m;
current = m;
this->initial_fen = initial_fen;