Add half-move clock validation

This commit is contained in:
Bruno BELANYI 2024-04-01 22:41:01 +01:00
parent 2853cec7c9
commit ef3a1e4695
2 changed files with 20 additions and 0 deletions

View file

@ -21,6 +21,8 @@ pub enum InvalidError {
OverlappingColors,
/// The pre-computed combined occupancy boards does not match the other boards.
ErroneousCombinedOccupancy,
/// Half-move clock is higher than total number of plies.
HalfMoveClockTooHigh,
}
impl std::fmt::Display for InvalidError {
@ -42,6 +44,7 @@ impl std::fmt::Display for InvalidError {
Self::ErroneousCombinedOccupancy => {
"The pre-computed combined occupancy boards does not match the other boards."
}
Self::HalfMoveClockTooHigh => "Half-move clock is higher than total number of plies.",
};
write!(f, "{}", error_msg)
}