Commit graph

9 commits

Author SHA1 Message Date
8e9da6aeff [board] Implement helpful piecewise constructors on Piece 2023-12-26 21:31:05 -07:00
371d37f688 [board] Implement TryFrom<char> and Into<char> for piece::Shape 2023-12-26 13:57:36 -07:00
758a3d95fc [board] Reorganize bitboard and position modules and export some symbols from the crate
Move position.rs to the position module and create a mod.rs.
Do the same for bitboard.rs in the bitboard modules.
Export Color, Piece, Position, and Square and use crate::Thing directly instead of referring to the symbol in the nested modules.
2023-12-26 11:25:27 -07:00
1575c83d31 [board] Rename PiecePlacementError::PieceExistsOnSquare → ExistsOnSquare 2023-12-26 11:20:01 -07:00
32c562e405 [board] Implement Color::other() that swaps the color for the other 2023-12-26 11:13:44 -07:00
fac98735e3 [board] Implement a Pieces iterator
This type iterates the pieces in a Position using the BitScanner struct to iterate all the occupied squares of the position's bitboards.
2023-12-26 09:19:38 -07:00
e0f1e1f6ff [board] Derive a bunch of traits for Color, Shape, Piece, and Square 2023-12-26 09:15:24 -07:00
a2f88f0fde [board] Give piece Color and shape enums integer values
Rename PieceShape → Shape
Remove color and piece modules from position.rs
2023-12-23 20:20:19 -07:00
9bcd0b2148 [board] Add neighbor and piece modules
Add a Direction enum in the neighbor module
Add Color and PieceShape enums, and a Piece struct to the piece module
2023-12-23 09:18:07 -07:00