diff options
author | eug-vs <eugene@eug-vs.xyz> | 2023-02-24 17:35:35 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2023-02-24 17:35:35 +0300 |
commit | 10a68da1249931a6220ca06affa063c187836bbd (patch) | |
tree | 7c691ed0c37a369d41e286263d2758f0597e1906 /src/moves.rs | |
parent | a7a26f7810e9bc5fec6020324a83a2a89b69ff79 (diff) | |
download | chessnost-10a68da1249931a6220ca06affa063c187836bbd.tar.gz |
feat: add initial multi-threaded UCI impl
Diffstat (limited to 'src/moves.rs')
-rw-r--r-- | src/moves.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/moves.rs b/src/moves.rs index e27d74c..3cf9fd3 100644 --- a/src/moves.rs +++ b/src/moves.rs @@ -1,3 +1,5 @@ +use std::str::Chars; + use crate::{square::Square, bitboard::BitboardFns, board::piece::Piece}; #[derive(Debug, Clone, PartialEq, Eq, Copy)] @@ -27,4 +29,10 @@ impl Move { pub fn is_tactical(&self) -> bool { matches!(self.kind, MoveKind::Capture | MoveKind::EnPassant) } + + pub fn from_notation(mut notation: Chars) -> Self { + let source = Square::from_notation(&mut notation).unwrap(); + let target = Square::from_notation(&mut notation).unwrap(); + Move { source, target, kind: MoveKind::Quiet } + } } |