diff options
Diffstat (limited to 'src/moves.rs')
-rw-r--r-- | src/moves.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/moves.rs b/src/moves.rs index 97032e5..a43ed4b 100644 --- a/src/moves.rs +++ b/src/moves.rs @@ -1,14 +1,14 @@ -use crate::{board::Square, bitboard::print}; +use crate::{square::Square, bitboard::print}; #[derive(Debug)] pub struct Move { - pub from: u8, - pub to: u8, + pub source: Square, + pub target: Square, } impl Move { pub fn print(&self) { - let bb = 1u64 << self.from | 1u64 << self.to; + let bb = self.source.to_bitboard() | self.target.to_bitboard(); print(bb, format!("{:?}", self).as_str()); } } @@ -21,7 +21,7 @@ mod tests { #[test] fn mock() { - let mov = Move { from: Square::E2 as u8, to: Square::E4 as u8 }; + let mov = Move { source: Square::E2, target: Square::E4 }; println!("{:?}", mov); } } |