Add 'ping' feature declaration for Xboard protocol
[purplehaze.git] / src / xboard.h
blob67444db9bc5c8bce21929949e91535bcb454fec7
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 = 4;
28 static const std::string XBOARD_FEATURES[XBOARD_NB_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::ofstream log;
39 bool force_mode;
40 bool debug_mode;
41 std::thread thinker;
42 public:
43 Xboard();
44 void loop();
45 void think();
48 #endif /* !XBOARD_H */