use crate::{square::Square, bitboard::print, board::PieceType}; #[derive(Debug, Clone, PartialEq, Eq, Copy)] pub enum MoveKind { Quiet, Capture, Castle, EnPassant, DoublePush, Promotion(PieceType), } #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Move { pub source: Square, pub target: Square, pub kind: MoveKind, } impl Move { pub fn print(&self) { let bb = self.source.to_bitboard() | self.target.to_bitboard(); print(bb, format!("{:?}", self).as_str()); } /// Tactical move is a move that changes material score pub fn is_tactical(&self) -> bool { match self.kind { MoveKind::Capture => true, MoveKind::EnPassant => true, _ => false, } } }