Rename ColorState to CastleState

This commit is contained in:
Aode (lion) 2021-12-31 17:43:57 -06:00
parent 82504a9c47
commit b7f5d55059

View file

@ -2,7 +2,7 @@ use crate::api_types::{Color, Coordinates, File, Move, Piece, PieceKind, Rank};
use std::collections::HashMap;
#[derive(Clone, Debug)]
struct ColorState {
struct CastleState {
can_king_castle: bool,
can_queen_castle: bool,
}
@ -14,14 +14,14 @@ struct PieceState {
struct SideEffects {
en_passant: Option<(Coordinates, Color)>,
color_state: ColorState,
color_state: CastleState,
}
#[derive(Clone, Debug, Default)]
pub(crate) struct BoardState {
inner: HashMap<Coordinates, PieceState>,
white_state: ColorState,
black_state: ColorState,
white_state: CastleState,
black_state: CastleState,
en_passant: Option<(Coordinates, Color)>,
}
@ -227,7 +227,7 @@ impl PieceState {
}
}
impl Default for ColorState {
impl Default for CastleState {
fn default() -> Self {
Self {
can_king_castle: true,