alexobviously / bishop

A chess logic package for Dart with flexible variant support
https://pub.dev/packages/bishop
Other
19 stars 8 forks source link

Override == and hashCode for GameResults #61

Open alexobviously opened 1 year ago

alexobviously commented 1 year ago

Use case: allow code like g.result == WonGameCheckMate(winner: Bishop.white)

Probably even more useful is g.result.isWon(Bishop.white) (allowing the winner to be null also, in which case it's the same as a is WonGame check.

cc @callumbeaney