From 24af6ea89a783e30514c9d5396b871621a044c27 Mon Sep 17 00:00:00 2001 From: Paolo Capriotti Date: Fri, 17 Aug 2007 11:50:15 +0200 Subject: [PATCH] Removed FEN stuff from the API. Fixed ticket #7. --- src/game.cpp | 2 ++ src/gnushogiengine.cpp | 6 +++--- src/hlvariant/tagua_wrapped.h | 10 +--------- src/tagua.h | 8 -------- src/xboardengine.cpp | 6 +++--- 5 files changed, 9 insertions(+), 23 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 10bf173..32afe36 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -821,10 +821,12 @@ void Game::load(const PGN& pgn) { pos = vi->createPosition(); pos->setup(); } +#if 0 // BROKEN else if( !(pos = vi->createPositionFromFEN(fen->second))) { ERROR("Wrong fen " << fen->second); return; } +#endif //TODO: what about options? FEN rules? diff --git a/src/gnushogiengine.cpp b/src/gnushogiengine.cpp index 156a9b2..2bc1282 100644 --- a/src/gnushogiengine.cpp +++ b/src/gnushogiengine.cpp @@ -102,13 +102,13 @@ void GNUShogiEngine::stopAnalysis() { m_analysing = false; } -void GNUShogiEngine::setBoard(AbstractPosition::Ptr pos, int halfmove, int fullmove) { +void GNUShogiEngine::setBoard(AbstractPosition::Ptr, int, int) { + #if 0 if (m_features.setboard) { sendCommand(QString("setboard %1").arg(pos->fen(halfmove, fullmove))); } else { // this is pretty meaningless for generic variants - #if 0 if (pos->turn() != 0) { sendCommand("new"); sendCommand("a2a3"); @@ -127,7 +127,7 @@ void GNUShogiEngine::setBoard(AbstractPosition::Ptr pos, int halfmove, int fullm } } sendCommand("."); - #endif } + #endif } diff --git a/src/hlvariant/tagua_wrapped.h b/src/hlvariant/tagua_wrapped.h index d10c1c1..d8f4b66 100644 --- a/src/hlvariant/tagua_wrapped.h +++ b/src/hlvariant/tagua_wrapped.h @@ -331,11 +331,7 @@ namespace HLVariant { virtual QString state() const { return ""; // BROKEN } - - virtual QString fen(int, int) const { - return ""; // BROKEN - } - + virtual PiecePtr moveHint(const MovePtr&) const { return PiecePtr(); // BROKEN } @@ -431,10 +427,6 @@ namespace HLVariant { return PositionPtr( new WrappedPosition(GameState())); // BROKEN } - - virtual PositionPtr createPositionFromFEN(const QString&) { - return PositionPtr(); // BROKEN - } virtual void forallPieces(class PieceFunction&) { // BROKEN diff --git a/src/tagua.h b/src/tagua.h index ac409f1..627c1cc 100644 --- a/src/tagua.h +++ b/src/tagua.h @@ -274,13 +274,6 @@ public: virtual QString state() const = 0; /** - * Return a FEN representation for the position, assuming - * @a halfmove as halfmove clock and @a fullmove as full move - * number. - */ - virtual QString fen(int halfmove, int fullmove) const = 0; - - /** * A piece somehow representing or related to the move * which has to be drawn by the interface. * Examples: @@ -344,7 +337,6 @@ public: virtual ~VariantInfo() { } virtual PositionPtr createPosition() = 0; virtual PositionPtr createCustomPosition(const OptList& l) = 0; - virtual PositionPtr createPositionFromFEN(const QString& fen) = 0; virtual void forallPieces(class PieceFunction&) = 0; virtual int moveListLayout() const = 0; virtual AnimatorPtr createAnimator(GraphicalAPI* graphical_api) = 0; diff --git a/src/xboardengine.cpp b/src/xboardengine.cpp index 37ba21c..0319d62 100644 --- a/src/xboardengine.cpp +++ b/src/xboardengine.cpp @@ -170,13 +170,13 @@ void XBoardEngine::stopAnalysis() { m_analysing = false; } -void XBoardEngine::setBoard(AbstractPosition::Ptr pos, int halfmove, int fullmove) { +void XBoardEngine::setBoard(AbstractPosition::Ptr, int, int) { + #if 0 if (m_features.setboard) { sendCommand(QString("setboard %1").arg(pos->fen(halfmove, fullmove))); } else { // this is pretty meaningless for generic variants - #if 0 if (pos->turn() != 0) { sendCommand("new"); sendCommand("a2a3"); @@ -195,7 +195,7 @@ void XBoardEngine::setBoard(AbstractPosition::Ptr pos, int halfmove, int fullmov } } sendCommand("."); - #endif } + #endif } -- 2.11.4.GIT