From 0505423bde48b35893863450cfacdf3484ca4696 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Fri, 1 Jan 2021 23:04:35 +0800 Subject: [PATCH] Remove unused millList because rule canRepeated is not supported --- src/position.cpp | 56 ------------------------------------------------ src/position.h | 26 ---------------------- 2 files changed, 82 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 94f84a4e..b3aaadb4 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1356,23 +1356,6 @@ void Position::mirror(vector &moveHistory, bool cmdChange /*= true*/) currentSquare = static_cast(f * RANK_NB + r); } - - for (auto &mill : millList) { - llp[0] = (mill & 0x000000ff00000000) >> 32; - llp[1] = (mill & 0x0000000000ff0000) >> 16; - llp[2] = (mill & 0x00000000000000ff); - - for (i = 0; i < 3; i++) { - f = static_cast(llp[i]) / RANK_NB; - r = static_cast(llp[i]) % RANK_NB; - r = (RANK_NB - r) % RANK_NB; - llp[i] = static_cast(f * RANK_NB + r); - } - - mill &= 0xffffff00ff00ff00; - mill |= (llp[0] << 32) | (llp[1] << 16) | llp[2]; - } - if (cmdChange) { unsigned r1, s1, r2, s2; int args = 0; @@ -1478,28 +1461,6 @@ void Position::turn(vector &moveHistory, bool cmdChange /*= true*/) currentSquare = static_cast(f * RANK_NB + r); } - for (auto &mill : millList) { - llp[0] = (mill & 0x000000ff00000000) >> 32; - llp[1] = (mill & 0x0000000000ff0000) >> 16; - llp[2] = (mill & 0x00000000000000ff); - - for (i = 0; i < 3; i++) { - f = static_cast(llp[i]) / RANK_NB; - r = static_cast(llp[i]) % RANK_NB; - - if (f == 1) - f = FILE_NB; - else if (f == FILE_NB) - f = 1; - - llp[i] = static_cast(f * RANK_NB + r); - } - - mill &= 0xffffff00ff00ff00; - mill |= (llp[0] << 32) | (llp[1] << 16) | llp[2]; - } - - // 命令行解析 if (cmdChange) { unsigned r1, s1, r2, s2; int args = 0; @@ -1597,7 +1558,6 @@ void Position::rotate(vector &moveHistory, int degrees, bool cmdChange Piece ch1, ch2; int f, r; - int i; if (degrees == 2) { for (f = 1; f <= FILE_NB; f++) { @@ -1665,22 +1625,6 @@ void Position::rotate(vector &moveHistory, int degrees, bool cmdChange currentSquare = static_cast(f * RANK_NB + r); } - for (auto &mill : millList) { - llp[0] = (mill & 0x000000ff00000000) >> 32; - llp[1] = (mill & 0x0000000000ff0000) >> 16; - llp[2] = (mill & 0x00000000000000ff); - - for (i = 0; i < 3; i++) { - f = static_cast(llp[i]) / RANK_NB; - r = static_cast(llp[i]) % RANK_NB; - r = (r + RANK_NB - degrees) % RANK_NB; - llp[i] = static_cast(f * RANK_NB + r); - } - - mill &= 0xffffff00ff00ff00; - mill |= (llp[0] << 32) | (llp[1] << 16) | llp[2]; - } - if (cmdChange) { unsigned r1, s1, r2, s2; int args = 0; diff --git a/src/position.h b/src/position.h index 66f2b0c3..35a7c370 100644 --- a/src/position.h +++ b/src/position.h @@ -191,32 +191,6 @@ public: char record[64] { '\0' }; - /* - 0x 00 00 00 00 00 00 00 00 - unused unused piece1 square1 piece2 square2 piece3 square3 - */ - - uint64_t millList[4]; - - /* - 0x 00 00 - square1 square2 - Placing:0x00??,?? is place location - Moving:0x__??,__ is from,?? is to - Removing:0xFF??,?? is neg - - 31 ----- 24 ----- 25 - | \ | / | - | 23 -- 16 -- 17 | - | | \ | / | | - | | 15 08 09 | | - 30-22-14 10-18-26 - | | 13 12 11 | | - | | / | \ | | - | 21 -- 20 -- 19 | - | / | \ | - 29 ----- 28 ----- 27 - */ Move move { MOVE_NONE }; };