diff options
author | eug-vs <eugene@eug-vs.xyz> | 2023-01-23 11:21:47 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2023-01-23 11:21:47 +0300 |
commit | 7db4fb8f8019449570ea85379b938617353ca8bb (patch) | |
tree | b8889ce9b3ef880bca7f1d897a63a6a10aff621c /src/moves.rs | |
parent | 869e7a11ffc832afbbc7fb999ffdb643db109bed (diff) | |
download | chessnost-7db4fb8f8019449570ea85379b938617353ca8bb.tar.gz |
refactor: store kind in a move struct
Diffstat (limited to 'src/moves.rs')
-rw-r--r-- | src/moves.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/moves.rs b/src/moves.rs index 3f55b2f..d6695a1 100644 --- a/src/moves.rs +++ b/src/moves.rs @@ -1,9 +1,18 @@ use crate::{square::Square, bitboard::print}; #[derive(Debug, Clone, Copy)] +pub enum MoveKind { + Quiet, + Capture, + Castle, + EnPassant, +} + +#[derive(Debug, Clone, Copy)] pub struct Move { pub source: Square, pub target: Square, + pub kind: MoveKind, } impl Move { @@ -21,7 +30,7 @@ mod tests { #[test] fn mock() { - let mov = Move { source: Square::E2, target: Square::E4 }; + let mov = Move { source: Square::E2, target: Square::E4, kind: MoveKind::Quiet }; println!("{:?}", mov); } } |