[moves] Clean up implementation of Move and export Kind enum
This commit is contained in:
parent
9010f1e9c2
commit
6816e350eb
4 changed files with 16 additions and 16 deletions
|
@ -2,8 +2,9 @@
|
|||
|
||||
use chessfriend_core::Shape;
|
||||
|
||||
#[repr(u16)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub(crate) enum Kind {
|
||||
pub enum Kind {
|
||||
Quiet = 0b0000,
|
||||
DoublePush = 0b0001,
|
||||
KingSideCastle = 0b0010,
|
||||
|
@ -14,12 +15,6 @@ pub(crate) enum Kind {
|
|||
CapturePromotion = 0b1100,
|
||||
}
|
||||
|
||||
impl Kind {
|
||||
fn is_reversible(self) -> bool {
|
||||
(self as u16) & 0b1100 == 0
|
||||
}
|
||||
}
|
||||
|
||||
#[repr(u16)]
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub enum PromotionShape {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue