Returns the next or previous card based on deck ordering. Respects
the deck of the current card (i.e. will return a card from the same
deck) but will return None on the boundaries of the deck (3(D) and
2(S)).
My previous impl was based on some testing for different Pair
footstool implementations. However, I've decided to fix it to this
set of patterns:
1) any half footstool must come from a more dominant hand.
2) full footstools are symmetric and require both hands to be
equivalent
Instead of our more complicated interpretation before where we'd care
about whether something is proper or not, here we're just using a form
of reverse lexicographical on the Pair.
I wanted to abstract ordered to any size instead of just binary
tuples - but tuples have a strange issue where you can't be generic
about them past like a limit of 12. With this setup, ordered takes
ownership of some fixed array, sorts it, then returns it back.
modes:pair and modes:single have been refactored to utilise this new
form of ordered - it's basically the exact same in these cases.
Nested iteration in the form presented before was quite bad - while
it's a bit more efficient to iterate once and do all the tests in that
one go, it can be kinda hard to preserve the context in ones head.
This style makes it easier to see the flow of data and what is being
tested.
A "proper" hand is one that has no wild cards - an "improper" hand is
one that does have at least one wild card.
~is_proper~ should be implemented for any Hand - ~is_improper~ falls
out for free.
Implemented for Single and Pair.
I want my build to tell me if there's anything wrong with it. Dead
Code warnings distract me from checking that.
OTOH when I'm running Clippy I want it to catch everything. Hence
this change.
Instead of doing a deep-check where we compare their best member
before their worst member, we just compare by the best member.
This allows (Joker, 4S) to be equal to (4C, 4S).
So strange that this isn't default for tuple-like constructors. I can
kinda get it for record-like constructors, but not for this. Better
safe than sorry I guess?