Remove generated files.
[tagua/yd.git] / src / engineinfo.h
blobbf5ec269be575983f27259fcbed13d815035b037
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
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.
9 */
11 #ifndef ENGINEINFO_H
12 #define ENGINEINFO_H
14 #include <QString>
15 #include <QObject>
16 #include <boost/shared_ptr.hpp>
17 #include "controllers/entitytoken.h"
19 class Engine;
20 class UI;
22 struct EngineDetails {
23 enum EngineType {
24 XBoard,
25 UCI,
26 TaguaText,
27 TaguaDBUS,
28 Unknown
31 QString name;
32 QString path;
33 EngineType type;
34 QString workPath;
36 EngineDetails(const QString& name, const QString& path, const EngineType& type)
37 : name(name), path(path), type(type) { }
38 EngineDetails() { }
40 static QString typeName(EngineType t) {
41 switch (t) {
42 case XBoard:
43 return "xboard";
44 case UCI:
45 return "UCI";
46 case TaguaText:
47 return "tagua-text";
48 case TaguaDBUS:
49 return "tagua-dbus";
50 default:
51 return "unknown";
55 static EngineType typeFromName(const QString& name) {
56 if (name == "xboard")
57 return XBoard;
58 else if (name == "UCI")
59 return UCI;
60 else if (name == "tagua-text")
61 return TaguaText;
62 else if (name == "tagua-dbus")
63 return TaguaDBUS;
64 else return Unknown;
68 class EngineInfo : public QObject {
69 Q_OBJECT
70 EngineDetails m_details;
71 UI& m_ui;
72 EntityToken m_token;
73 protected:
74 virtual boost::shared_ptr<Engine> engine();
75 public:
76 EngineInfo(const EngineDetails& details, UI& ui);
77 void setWorkPath(const QString& wp) { m_details.workPath = wp; }
78 public Q_SLOTS:
79 void playAsWhite();
80 void playAsBlack();
81 void analyze();
84 #endif // ENGINEINFO_H