7c2b9ed97a
[board] Add inline and const modifiers to methods on PlacedPiece
2024-01-06 08:49:51 -08:00
750b16970f
[board] Create const arrays for Shape that return &'static to its enum cases
2023-12-31 11:44:47 -08:00
41421dddbb
[board] Clean up interfaces of pieces and square structs
2023-12-29 09:17:33 -08:00
e1e27fc668
[board] Implement TryFrom<&str> for Shape
...
Convert a string to a Shape using the first character in the string.
Rename TryFromCharError → TryFromError
2023-12-28 19:50:02 -07:00
49c5a0b51d
[board] Implement fmt::Display for Piece
2023-12-26 21:33:00 -07:00
ecc1ee85d4
[board] Remove an unintentional recursion in fmt::Display for piece::Shape
2023-12-26 21:31:44 -07:00
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