From 30a7c466e535e915a84bf4ed91b3ce0eedbf47a5 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 2 Apr 2026 06:17:58 +0100 Subject: [PATCH] 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. --- src/modes/pair.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modes/pair.rs b/src/modes/pair.rs index 310f34d..271ed91 100644 --- a/src/modes/pair.rs +++ b/src/modes/pair.rs @@ -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 {