niklasf / shakmaty

A Rust library for chess and chess variant rules and operations
https://docs.rs/shakmaty
GNU General Public License v3.0
210 stars 41 forks source link

Implement Hash & PartialEq on variants #68

Closed UE2020 closed 1 year ago

UE2020 commented 1 year ago

The Chess struct has Hash & PartialEq implemented, while all the variants do not. Is there any reason why, or is it just a missing feature?

niklasf commented 1 year ago

Just a missing feature. Would be nice to have.

UE2020 commented 1 year ago

I've made a pull request (#69) which implements Hash and PartialEq on every variant. However, is there any reason why the en passant square is not hashed in the implementation for Chess? I copied your original implementation for all the variants but I'm wondering if this is intentional or it's a mistake.