[core, position] Rename the type of Score's inner value → Value

This commit is contained in:
Eryn Wells 2025-06-24 20:00:04 -07:00
parent 4e80cc36ca
commit 1ae6d5df48
3 changed files with 57 additions and 18 deletions

View file

@ -19,10 +19,10 @@ impl Evaluator {
fn material_balance(board: &Board, color: Color) -> Score {
let other_color = color.other();
Shape::into_iter().fold(Score::zero(), |acc, shape| {
Shape::into_iter().fold(Score::ZERO, |acc, shape| {
let (active_pieces, other_pieces) = (
board.count_piece(&Piece::new(color, shape)) as i32,
board.count_piece(&Piece::new(other_color, shape)) as i32,
i32::from(board.count_piece(&Piece::new(color, shape))),
i32::from(board.count_piece(&Piece::new(other_color, shape))),
);
let factor = shape.score() * (active_pieces - other_pieces);