typing improvements

This commit is contained in:
2025-04-18 23:52:13 -04:00
parent 85e3a11897
commit 625b02c13a
4 changed files with 13 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
use crate::{
logic::r#move::Move,
repr::{Board, CoordPair, Piece, Winner},
repr::{Board, Piece, Winner},
};
use allocative::Allocative;
use indicatif::{ParallelProgressIterator, ProgressStyle};
@@ -15,6 +15,8 @@ use std::{
},
};
use super::r#move::MoveCoord;
#[derive(Allocative)]
pub struct FutureMoves {
/// Arena containing all [`Move`]
@@ -354,7 +356,7 @@ impl FutureMoves {
}
}
fn move_history(&self, idx: usize) -> Option<Vec<(Option<CoordPair>, Piece)>> {
fn move_history(&self, idx: usize) -> Option<Vec<(MoveCoord, Piece)>> {
if let Some(root) = self.current_root {
let mut hist = Vec::new();
@@ -395,7 +397,7 @@ impl FutureMoves {
}
/// Return the best move which is a child of `self.current_root`
pub fn best_move(&self) -> Option<Option<CoordPair>> {
pub fn best_move(&self) -> Option<MoveCoord> {
self.current_root
.and_then(|x| {
self.arena[x]