2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
11 #ifndef XBOARDENGINE_H
12 #define XBOARDENGINE_H
20 * @brief A chess engine compatible with xboard.
22 * XBoard compatible engines are defined by Tim Mann's
23 * Chess Engine Communication Protocol (available at
24 * http://tim-mann.org/xboard/engine-intf.html), used
25 * by GNU Chess, Crafty and many other free and commercial
27 * This class encapsulates such communication protocol,
28 * calling appropriate methods of the notifier upon engine
31 * @note This code is partially stolen from Maurizio Monge's
32 * old interface project outoftime.
34 class XBoardEngine
: public Engine
{
60 static QRegExp m_move_pattern
;
63 * Initialize the engine.
65 virtual void initializeEngine();
68 * Parse engine command line and the appropriate
71 void processCommand(const QString
& command
);
74 * Create an xboard compatible engine.
76 XBoardEngine(const QString
& path
, const QStringList
& arguments
);
79 * Terminate the engine.
81 virtual ~XBoardEngine();
84 * Send a move to the engine.
86 virtual void sendMove(AbstractMove::Ptr move
, AbstractPosition::Ptr ref
);
90 * @param pos The position before the move. Used if the engine
91 * does not support the undo command.
93 virtual void backUp(AbstractPosition::Ptr pos
);
95 virtual void setBoard(AbstractPosition::Ptr pos
, int halfmove
, int fullmove
);
101 virtual void reset();
113 virtual void startAnalysis();
114 virtual void stopAnalysis();
117 #endif // XBOARDENGINE_H