modes:mod:Hand: is_proper and is_improper indicator functions
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.
This commit is contained in:
@@ -43,6 +43,10 @@ use crate::modes::single::Single;
|
||||
use crate::modes::{Footstool, Hand};
|
||||
|
||||
impl Hand for Pair {
|
||||
fn is_proper(&self) -> bool {
|
||||
matches!(self.0, Card::PlayingCard(_))
|
||||
}
|
||||
|
||||
fn footstool(&self, other: &Self) -> Footstool {
|
||||
// A pair footstools the other <=> the highest cards of both footstool
|
||||
// each other => we can rely on the footstool implementation of Single
|
||||
|
||||
Reference in New Issue
Block a user