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

@@ -2,10 +2,12 @@ use super::board_value::BoardValueMap;
use crate::repr::{Board, CoordPair, Piece, Winner};
use allocative::Allocative;
pub type MoveCoord = Option<CoordPair>;
#[derive(Clone, Debug, Allocative)]
pub struct Move {
/// Coordinates (i, j) of the move (if it exists)
pub coord: Option<CoordPair>,
pub coord: MoveCoord,
/// Current winner of the match
pub winner: Winner,
@@ -34,7 +36,7 @@ pub struct Move {
}
impl Move {
pub fn new(coord: Option<CoordPair>, board: Board, color: Piece, agent_color: Piece) -> Self {
pub fn new(coord: MoveCoord, board: Board, color: Piece, agent_color: Piece) -> Self {
let mut m = Move {
coord,
winner: board.game_winner(),