]> git.sesse.net Git - stockfish/blobdiff - src/uci.cpp
Retire Application class
[stockfish] / src / uci.cpp
index c9ecbf234fc16f993582e30bf1a9e62aac3ab1d8..a4a73fbf3eea557e05d1e4da9c86288a325c29fc 100644 (file)
@@ -27,7 +27,6 @@
 #include <sstream>
 #include <string>
 
-#include "book.h"
 #include "evaluate.h"
 #include "misc.h"
 #include "move.h"
@@ -35,7 +34,6 @@
 #include "position.h"
 #include "san.h"
 #include "search.h"
-#include "uci.h"
 #include "ucioption.h"
 
 using namespace std;
@@ -121,10 +119,7 @@ namespace {
         cout << "uciok" << endl;
     }
     else if (token == "ucinewgame")
-    {
-        set_option_value("New Game", "true");
         pos.from_fen(StartPositionFEN);
-    }
     else if (token == "isready")
         cout << "readyok" << endl;
     else if (token == "position")
@@ -233,16 +228,22 @@ namespace {
     while (uip >> token && token != "value")
         name += (" " + token);
 
+    if (Options.find(name) == Options.end())
+    {
+        cout << "No such option: " << name << endl;
+        return;
+    }
+
     if (token != "value" || !(uip >> value))
     {
-        set_option_value(name, "true");
+        Options[name].set_value("true");
         return;
     }
 
     while (uip >> token)
         value += (" " + token);
 
-    set_option_value(name, value);
+    Options[name].set_value(value);
   }