[board] Remove BoardSide enum; use Castle everywhere

Move Castle to a castle module inside the move module.
Implement into_index() on Castle to turn it into a usize.
This commit is contained in:
Eryn Wells 2024-01-21 10:38:50 -08:00
parent 21b5266789
commit fa1c6b452e
8 changed files with 95 additions and 63 deletions

View file

@ -11,23 +11,6 @@ use crate::{
};
use std::{cell::OnceCell, fmt};
/// A lateral side of the board relative to the player. Kingside is the side the
/// player's king starts on. Queenside is the side of the board the player's
/// queen starts on.
pub(crate) enum BoardSide {
King = 0,
Queen = 1,
}
impl From<Castle> for BoardSide {
fn from(value: Castle) -> Self {
match value {
Castle::KingSide => BoardSide::King,
Castle::QueenSide => BoardSide::Queen,
}
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Position {
color_to_move: Color,