shakmaty integration#137
Conversation
|
I wanted to make it incremental (one by one, works at every step), but that would waste an enormous amount of time because a ton of code is not necessary with shakmaty so I would be changing it just to remove it later. So, I identified some things that can be removed, with explanations. I've removed the tests associated with that too.
Note that I haven't implemented the replacements, so the code obviously doesn't compile. I just removed stuff I'm positive can be replaced with a much smaller, better version using shakmaty. |
Removed:
- `add_piece_to_taken_pieces`: removed because shakmaty will make this trivial
- `is_latest_move_en_passant`: only used in `execute_move`, which will get revamped, and `add_piece_to_taken_piece`, which was removed
- `consecutive_non_pawn_or_capture` getter and setter. I made the field public instead, because there's no additional work being done by the getter/setter
Refactored:
- `board_history` -> `position_history` to better reflect shakmaty's naming. `board` was removed because we were already using `position_history` to store the current position, no reason to store it twice.
- merged `{white,black}_taken_pieces` to `taken_pieces: Vec<Piece>`
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
|
Hello @tigerros I am working on this pr right now and taking the time to completely refactor chess tui for a proper v2 using shakmaty, I will ping you when this will be done so we can check together the implementation and optimize it to the best |
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
- improve the toml loading with serde - improve the methods and remove useless mut - remove some unwraps Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
|
Hello @tigerros it seems like I completed the migration ! |
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Addresses #135. It's not complete, I'm just putting this out here as a kind of tracker (this branch will be updated further) and also so that maintainers can contribute too if they want to.
Changes:
PieceColorwithshakmaty::Color, import if there's no conflict with ratatui.Checklist: