-
Notifications
You must be signed in to change notification settings - Fork 0
/
Uci.hpp
51 lines (41 loc) · 1.2 KB
/
Uci.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef CHESS_ENGINE_UCI_HPP
#define CHESS_ENGINE_UCI_HPP
#include "Board.hpp"
#include "TimeInfo.hpp"
#include <string>
#include <iosfwd>
#include <memory>
#include <map>
class Engine;
class PrincipalVariation;
class UciOptionBase;
class Uci {
public:
Uci(std::unique_ptr<Engine> engine,
std::istream& cmdIn,
std::ostream& cmdOut,
std::ostream& log);
~Uci();
void run();
private:
void runCommand(const std::string& line);
void uciCommand(std::istream& stream);
void isreadyCommand(std::istream& stream);
void ucinewgameCommand(std::istream& stream);
void positionCommand(std::istream& stream);
void goCommand(std::istream& stream);
void quitCommand(std::istream& stream);
void setoptionCommand(std::istream& stream);
TimeInfo::Optional readTimeInfo(std::istream& stream);
void sendPvInfo(const PrincipalVariation& pv);
void sendOptions();
void sendCommand(const std::string& line);
void error(const std::string& msg);
std::unique_ptr<Engine> engine_;
Board board_;
std::istream& cmdIn_;
std::ostream& cmdOut_;
std::ostream& log_;
std::map<std::string, std::unique_ptr<UciOptionBase>> options_;
};
#endif