typing improvements
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user