abstract away more coordinates

This commit is contained in:
2025-02-27 21:00:04 -05:00
parent 956386fb66
commit 6ae1726010
12 changed files with 251 additions and 204 deletions

View File

@@ -1,11 +1,11 @@
use super::board_value::BoardValueMap;
use crate::repr::{Board, Coord, Piece, Winner};
use crate::repr::{Board, CoordPair, Piece, Winner};
use lazy_static::lazy_static;
#[derive(Clone, Debug)]
pub struct Move {
/// Coordinates (i, j) of the move (if it exists)
pub coord: Option<(Coord, Coord)>,
pub coord: Option<CoordPair>,
/// [`Board`] state after move is made
pub board: Board,
@@ -40,12 +40,7 @@ lazy_static! {
}
impl Move {
pub fn new(
coord: Option<(Coord, Coord)>,
board: Board,
color: Piece,
agent_color: Piece,
) -> Self {
pub fn new(coord: Option<CoordPair>, board: Board, color: Piece, agent_color: Piece) -> Self {
let mut m = Move {
coord,
board,