Skip to content

Commit

Permalink
Add castle rights
Browse files Browse the repository at this point in the history
Will probably add a bunch of convenience methods here, but for now this is just a plain enum.
  • Loading branch information
bsamseth committed Oct 31, 2024
1 parent ee68db3 commit f208e7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions goldchess/src/castlerights.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// Represent what castling rights are available to a player.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CastleRights {
None,
KingSide,
QueenSide,
Both,
}
2 changes: 2 additions & 0 deletions goldchess/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//! This is a library useful for writing chess engines in Rust. Its primary reason to exist is to
//! support the [Goldfish](https://github.com/bsamseth/goldfish) chess engine, but very well might be useful for other projects as well.
mod bitboard;
mod castlerights;
mod color;
mod error;
mod file;
Expand All @@ -16,6 +17,7 @@ mod rank;
mod square;

pub use bitboard::Bitboard;
pub use castlerights::CastleRights;
pub use color::Color;
pub use error::{Error, Result};
pub use file::File;
Expand Down

0 comments on commit f208e7b

Please sign in to comment.