Move Xboard search in a thread
[purplehaze.git] / src / xboard.h
blob3813506f81de380b7df11d4b4b400018400569fc
1 /* Copyright (C) 2007-2011 Vincent Ollivier
3 * Purple Haze is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * Purple Haze is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef XBOARD_H
18 #define XBOARD_H
20 #include <iostream>
21 #include <fstream>
22 #include <string>
23 #include <thread>
25 #include "protocol.h"
27 static const int XBOARD_NB_FEATURES = 3;
28 static const std::string XBOARD_FEATURES[XBOARD_NB_FEATURES][2] = {
29 { "myname", "Purple Haze " + static_cast<std::string>(VERSION) },
30 { "setboard", "1" },
31 { "done", "1" },
34 class Xboard : public Protocol
36 private:
37 std::ofstream log;
38 bool force_mode;
39 bool debug_mode;
40 std::thread thinker;
41 public:
42 Xboard();
43 void loop();
44 void think();
47 #endif /* !XBOARD_H */