Remove the Copy trait from most move Styles and add Clone, Debug, Eq, and PartialEq to Promotion and Castle

This commit is contained in:
Eryn Wells 2024-02-13 11:03:28 -07:00
parent f23967f4f3
commit e172bfb5dd

View file

@ -31,43 +31,45 @@ pub trait Style {
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Builder<S: Style> {
style: S,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Null;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Push {
from: Option<Square>,
to: Option<Square>,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct DoublePush {
from: Square,
to: Square,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Capture {
push: Push,
capture: Option<Square>,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct EnPassantCapture {
push: Push,
capture: Option<Square>,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Promotion<S> {
style: S,
promotion: PromotionShape,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Castle {
castle: castle::Castle,
}