chessfriend/moves/src/generators.rs

29 lines
540 B
Rust

// Eryn Wells <eryn@erynwells.me>
mod knight;
mod pawn;
#[cfg(test)]
mod testing;
pub use knight::KnightMoveGenerator;
pub use pawn::PawnMoveGenerator;
use crate::Move;
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub struct GeneratedMove {
pub(crate) ply: Move,
}
impl std::fmt::Display for GeneratedMove {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.ply.fmt(f)
}
}
impl From<Move> for GeneratedMove {
fn from(value: Move) -> Self {
GeneratedMove { ply: value }
}
}