Better comments and enums in the proto file.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 17 Mar 2016 01:05:59 +0000 (02:05 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 24 Nov 2018 10:17:41 +0000 (11:17 +0100)
src/hashprobe.proto
src/main.cpp

index 5df9b9c..393553e 100644 (file)
@@ -1,15 +1,21 @@
 syntax = "proto3";
-
 message HashProbeRequest {
        string fen = 1;
 }
 message HashProbeResponse {
        bool found = 1;
-       int32 move = 2;
-       int32 value = 3;
-       int32 eval = 4;
+       int32 move = 2;  // See types.h
+       int32 value = 3;  // Dynamic eval (may be inexact, see the "bound" field)
+       int32 eval = 4;  // Static eval
        int32 depth = 5;
-       int32 bound = 6;
+
+       enum ValueBound {
+               BOUND_NONE = 0;
+               BOUND_UPPER = 1;
+               BOUND_LOWER = 2;
+               BOUND_EXACT = 3;
+       };
+       ValueBound bound = 6;
 }
 
 service HashProbe {
index ee0f135..b6639f2 100644 (file)
@@ -57,7 +57,7 @@ public:
                        response->set_value(entry->value());
                        response->set_eval(entry->eval());
                        response->set_depth(entry->depth());
-                       response->set_bound(entry->bound());
+                       response->set_bound(HashProbeResponse::ValueBound(entry->bound()));
                }
                return Status::OK;
        }