~ubuntu-branches/debian/sid/chessx/sid

« back to all changes in this revision

Viewing changes to src/database/uciengine.h

  • Committer: Package Import Robot
  • Author(s): Niklas Fiekas
  • Date: 2013-10-31 17:02:37 UTC
  • Revision ID: package-import@ubuntu.com-20131031170237-wghf5j9jlv28gmls
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   (C) 2006-2007 Sean Estabrooks                                         *
 
3
 *   (C) 2007-2009 Michal Rudolf <mrudolf@kdewebdev.org>                   *
 
4
 *                                                                         *
 
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.                                   *
 
9
 ***************************************************************************/
 
10
 
 
11
#ifndef __UCIENGINE_H__
 
12
#define __UCIENGINE_H__
 
13
 
 
14
#include <QString>
 
15
#include <QTextStream>
 
16
 
 
17
#include "engine.h"
 
18
 
 
19
/** @ingroup Feature
 
20
* The UCIEngine class provides an interface to Winboard/XBoard engines.
 
21
*/
 
22
class UCIEngine : public Engine
 
23
{
 
24
public:
 
25
    /** Constucts an engine with a given path/command, and log stream */
 
26
    UCIEngine(const QString& name,
 
27
              const QString& command,
 
28
              bool bTestMode,
 
29
              const QString& directory = QString(),
 
30
              QTextStream* logStream = NULL);
 
31
 
 
32
    /** Analyses the the given position */
 
33
    bool startAnalysis(const Board& board, int nv);
 
34
 
 
35
    /** Stops any analysis */
 
36
    void stopAnalysis();
 
37
 
 
38
    /** Update number of displayed lines. Restarts engine. */
 
39
    virtual void setMpv(int mpv);
 
40
 
 
41
    virtual bool providesMvp()
 
42
    {
 
43
        return true;
 
44
    }
 
45
protected:
 
46
    /** Performs any initialisation required by the engine protocol */
 
47
    void protocolStart();
 
48
 
 
49
    /** Performs any shutdown procedure required by the engine protocol */
 
50
    void protocolEnd();
 
51
 
 
52
    /** Processes messages from the chess engine */
 
53
    void processMessage(const QString& message);
 
54
 
 
55
private:
 
56
    /** Parses analysis */
 
57
    void parseAnalysis(const QString& message);
 
58
 
 
59
    /** Parse option string */
 
60
    void parseOptions(const QString &message);
 
61
 
 
62
    Board m_board;
 
63
 
 
64
    QString m_position;
 
65
    QString m_waitingOn;
 
66
    bool m_quitAfterAnalysis;
 
67
};
 
68
 
 
69
#endif // __UCIENGINE_H__