Commit graph

16 commits

Author SHA1 Message Date
a65fcd6000 [position] Rename fields of EnPassant struct
Append _square to each one.
2024-03-01 15:24:20 -08:00
5f1fce6cc2 Fix the remaining tests
Well… all the tests except the Peter Ellis Jones tests.

Pass around whole EnPassant types instead of pulling out just the e.p. square.
Make sure that Castling moves have their target and origin squares populated.
Add a color field to the Castle move style to make this possible.
2024-02-25 12:38:55 -08:00
2a6b098cb8 Fix the pawn unit tests 2024-02-25 10:51:27 -08:00
9b7bf3a212 Implement some helpful testing types and traits in the moves package 2024-02-25 09:15:07 -08:00
d714374f35 Pass self by reference to move builder methods where possible 2024-02-25 08:57:16 -08:00
b5d4069751 Make moves::castle::Parameters public
Rename this struct CastlingParameters → Parameters
Implement getter methods for private properties
2024-02-25 08:51:23 -08:00
b3e55f6dcd Split out some unchecked and check move build() methods
Unchecked are unsafe. Checked are safe.
2024-02-13 11:07:49 -07:00
047eb4fd77 Get en passant move building working (again?) 2024-02-13 11:05:02 -07:00
5d1ad73be6 In Move::capture_square, move the en passant check above the simple capture check 2024-02-13 11:04:21 -07:00
e172bfb5dd Remove the Copy trait from most move Styles and add Clone, Debug, Eq, and PartialEq to Promotion and Castle 2024-02-13 11:03:28 -07:00
3b8b6b36e3 Implement a basic Display for chessfriend_moves::Move 2024-02-11 10:23:07 -07:00
8724c3cdce Pad out the discriminants of Kind variants 2024-02-11 10:23:07 -07:00
e6a9b7f8c4 Return a chessfriend_moves::EnPassant from a new Position::en_passant()
Replace Position's en_passant_target_square() and en_passant_capture_square()
with a single en_passant() method that returns a new EnPassant struct that has
the target and capture squares for the en passant move.
2024-02-11 10:23:07 -07:00
c55b7c4877 Implement a whole new move crate 2024-02-11 10:23:07 -07:00
0bedf2aa9f Implement part of a new Builder using the type state pattern
The API for this is much easier to use.
2024-02-11 10:23:07 -07:00
f69c7d4c96 Move a bunch of stuff from the position::move module over to a new chessfriend_moves crate 2024-02-11 10:23:07 -07:00