From 85cdd2d0ed88a698c5ad7c4d7d3868bed8a56e7f Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sun, 25 Oct 2020 11:17:11 +0800 Subject: [PATCH] =?UTF-8?q?thread:=20us=20=E7=94=B1=20int=20=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=94=B9=E4=B8=BA=20Color?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/thread.cpp | 4 ++-- src/thread.h | 2 +- src/ui/qt/gamecontroller.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/thread.cpp b/src/thread.cpp index dd947f21..ecd617e3 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -362,10 +362,10 @@ void Thread::analyze(Color c) total = nbwin + nwwin + ndraw; - if (total == 0) { + if (total == 0) { bwinrate = 0; wwinrate = 0; - drawrate = 0; + drawrate = 0; } else { bwinrate = (float)nbwin * 100 / total; wwinrate = (float)nwwin * 100 / total; diff --git a/src/thread.h b/src/thread.h index e6c807cc..3ab6824e 100644 --- a/src/thread.h +++ b/src/thread.h @@ -131,7 +131,7 @@ public: Value bestvalue { VALUE_ZERO }; Value lastvalue { VALUE_ZERO }; - int us {1}; + Color us { BLACK }; private: int timeLimit; diff --git a/src/ui/qt/gamecontroller.h b/src/ui/qt/gamecontroller.h index c87a1598..8e2b46fa 100644 --- a/src/ui/qt/gamecontroller.h +++ b/src/ui/qt/gamecontroller.h @@ -278,10 +278,10 @@ public slots: void createAiThreads() { aiThread[BLACK] = new Thread(0); - aiThread[BLACK]->us = 1; + aiThread[BLACK]->us = BLACK; aiThread[WHITE] = new Thread(0); - aiThread[WHITE]->us = 2; + aiThread[WHITE]->us = WHITE; } void startAiThreads()