12345678910111213141516171819202122232425262728293031323334353637 |
- #include "UciParser.h"
- #include <sstream>
- #include "ChessGame.h"
- using namespace std;
- int UciParser::parse(istream& in, ostream& out)
- {
- while (!in.eof()) {
- string line;
- getline(in, line);
- executeLine(line);
- }
- return 0;
- }
- int UciParser::executeLine(const string& line)
- {
- stringstream s {line};
- string token;
- string command;
- vector<string> args;
- s >> command;
- while (s >> token) {
- args.push_back(token);
- }
- executeCommand(command, args);
- }
- int UciParser::executeCommand(const string& command,
- const vector<string>& args)
- {
- }
|