mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-25 11:36:51 +08:00
Change the Move enum to a class
This changes the Move enum to a class, this way all move related functions can be moved into the class and be more self contained. closes https://github.com/official-stockfish/Stockfish/pull/4958 No functional change
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
#include <cstdlib>
|
||||
#include <deque>
|
||||
#include <initializer_list>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
@@ -66,7 +66,7 @@ Thread::~Thread() {
|
||||
// Reset histories, usually before a new game
|
||||
void Thread::clear() {
|
||||
|
||||
counterMoves.fill(MOVE_NONE);
|
||||
counterMoves.fill(Move::none());
|
||||
mainHistory.fill(0);
|
||||
captureHistory.fill(0);
|
||||
pawnHistory.fill(0);
|
||||
@@ -220,9 +220,9 @@ void ThreadPool::start_thinking(Position& pos,
|
||||
|
||||
Thread* ThreadPool::get_best_thread() const {
|
||||
|
||||
Thread* bestThread = threads.front();
|
||||
std::map<Move, int64_t> votes;
|
||||
Value minScore = VALUE_NONE;
|
||||
Thread* bestThread = threads.front();
|
||||
std::unordered_map<Move, int64_t, Move::MoveHash> votes;
|
||||
Value minScore = VALUE_NONE;
|
||||
|
||||
// Find the minimum score of all threads
|
||||
for (Thread* th : threads)
|
||||
|
||||
Reference in New Issue
Block a user