Reorder README
[purplehaze.git] / src / xboard.h
blob5c04532a749962ac001de77dec5fcf33257627c7
1 /* Copyright (C) 2007-2012 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"
26 #include "log.h"
28 static const std::string XBOARD_FEATURES[][2] = {
29 { "myname", "Purple Haze " + static_cast<std::string>(VERSION) },
30 { "ping", "1" },
31 { "setboard", "1" },
32 { "done", "1" },
35 class Xboard : public Protocol
37 private:
38 std::thread thinker;
39 Log log;
40 bool force_mode;
42 public:
43 Xboard(const int tt_size = TT_SIZE, const int mt_size = MT_SIZE) :
44 Protocol(tt_size, mt_size),
45 force_mode(true)
48 void debug(std::string logfile) {
49 log.open(logfile);
52 void loop();
53 void think();
56 #endif /* !XBOARD_H */