diff --git a/moves/src/en_passant.rs b/moves/src/en_passant.rs index 49e88a6..9a0f972 100644 --- a/moves/src/en_passant.rs +++ b/moves/src/en_passant.rs @@ -5,8 +5,8 @@ use chessfriend_core::{Rank, Square}; /// En passant information. #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct EnPassant { - target: Square, - capture: Square, + target_square: Square, + capture_square: Square, } impl EnPassant { @@ -34,18 +34,21 @@ impl EnPassant { /// ``` pub fn from_target_square(target: Square) -> Option { match Self::_capture_square(target) { - Some(capture) => Some(Self { target, capture }), + Some(capture) => Some(Self { + target_square: target, + capture_square: capture, + }), None => None, } } /// The square the capturing piece will move to. pub fn target_square(&self) -> Square { - self.target + self.target_square } /// The square on which the captured pawn sits. pub fn capture_square(&self) -> Square { - self.capture + self.capture_square } }