aboutsummaryrefslogtreecommitdiff
path: root/src/bot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bot.cpp')
-rw-r--r--src/bot.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/bot.cpp b/src/bot.cpp
index f1f1fd6..b3e75d6 100644
--- a/src/bot.cpp
+++ b/src/bot.cpp
@@ -221,13 +221,19 @@ int PSTIndex(int square, bool white) { return white ? square : (56 ^ square); }
float EvaluateBoardForWhite(Game *g, int depth) {
float score = 0;
- if (g->state == WHITE_WON) {
+ GameState state = GetNewGameState(g);
+ switch (state) {
+ case WHITE_WON:
return MATE + depth;
- }
- if (g->state == BLACK_WON) {
+ break;
+ case BLACK_WON:
return -MATE - depth;
- }
- if (g->state == STALEMATE || g->state == DRAW) {
+ break;
+ case TURN:
+ break;
+ case STALEMATE:
+ return 0;
+ case DRAW:
return 0;
}