aboutsummaryrefslogtreecommitdiff
path: root/src/moves.rs
blob: 3f55b2fe2cf34d8c8295689695127d95049f3578 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use crate::{square::Square, bitboard::print};

#[derive(Debug, Clone, Copy)]
pub struct Move {
    pub source: Square,
    pub target: Square,
}

impl Move {
    pub fn print(&self) {
        let bb = self.source.to_bitboard() | self.target.to_bitboard();
        print(bb, format!("{:?}", self).as_str());
    }
}



#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn mock() {
        let mov = Move { source: Square::E2, target: Square::E4 };
        println!("{:?}", mov);
    }
}