modes:pair: Implement Hand for Pair
The footstool condition here is super simple since we just utilise the Single footstool condition against Pair::1 of both pairs.
This commit is contained in:
@@ -39,6 +39,18 @@ impl Pair {
|
||||
}
|
||||
}
|
||||
|
||||
use crate::modes::single::Single;
|
||||
use crate::modes::{Footstool, Hand};
|
||||
|
||||
impl Hand for Pair {
|
||||
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
|
||||
// for this.
|
||||
Single(self.1).footstool(&Single(other.1))
|
||||
}
|
||||
}
|
||||
|
||||
use std::fmt::{Display, Formatter, Result};
|
||||
|
||||
impl Display for Pair {
|
||||
|
||||
Reference in New Issue
Block a user