mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-25 19:46:55 +08:00
Split UCI into UCIEngine and Engine
This is another refactor which aims to decouple uci from stockfish. A new engine class manages all engine related logic and uci is a "small" wrapper around it. In the future we should also try to remove the need for the Position object in the uci and replace the options with an actual options struct instead of using a map. Also convert the std::string's in the Info structs a string_view. closes #5147 No functional change
This commit is contained in:
@@ -58,7 +58,7 @@ void format_cp_compact(Value v, char* buffer, const Position& pos) {
|
||||
|
||||
buffer[0] = (v < 0 ? '-' : v > 0 ? '+' : ' ');
|
||||
|
||||
int cp = std::abs(UCI::to_cp(v, pos));
|
||||
int cp = std::abs(UCIEngine::to_cp(v, pos));
|
||||
if (cp >= 10000)
|
||||
{
|
||||
buffer[1] = '0' + cp / 10000;
|
||||
@@ -92,7 +92,7 @@ void format_cp_compact(Value v, char* buffer, const Position& pos) {
|
||||
// Converts a Value into pawns, always keeping two decimals
|
||||
void format_cp_aligned_dot(Value v, std::stringstream& stream, const Position& pos) {
|
||||
|
||||
const double pawns = std::abs(0.01 * UCI::to_cp(v, pos));
|
||||
const double pawns = std::abs(0.01 * UCIEngine::to_cp(v, pos));
|
||||
|
||||
stream << (v < 0 ? '-'
|
||||
: v > 0 ? '+'
|
||||
|
||||
Reference in New Issue
Block a user