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:
2026-04-02 06:17:58 +01:00
committed by oreodave
parent 0328a828c8
commit 30a7c466e5

View File

@@ -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}; use std::fmt::{Display, Formatter, Result};
impl Display for Pair { impl Display for Pair {