Reimplement Square as an enum; implement Rank and File enums

Replace the Square struct with an enum. This implementation is based on this one:

https://github.com/analog-hors/magic-bitboards-demo/blob/main/types/src/square.rs

This reduces a lot of code needed to construct squares, ranks, and files.
This commit is contained in:
Eryn Wells 2024-01-06 16:08:22 -08:00
parent 1689da9908
commit 2105004dc2
2 changed files with 209 additions and 165 deletions

View file

@ -11,4 +11,4 @@ mod tests;
pub use moves::Move;
pub use position::Position;
pub use square::Square;
pub use square::{File, Rank, Square};