modes:single: implement Hand for Singles

Really trivial implementation.
This commit is contained in:
2026-04-02 05:27:10 +01:00
committed by oreodave
parent 99bfd9ed37
commit d2075cd000

View File

@@ -9,6 +9,24 @@ impl Single {
}
}
use crate::helper::ordered;
use crate::modes::{Footstool, Hand};
impl Hand for Single {
fn footstool(&self, other: Self) -> Footstool {
let self_abs = self.0.deck_abs();
let other_abs = other.0.deck_abs();
if self_abs == other_abs {
Footstool::Full
} else if self_abs == other_abs + 1 {
Footstool::Half
} else {
Footstool::None
}
}
}
use std::fmt::{Display, Formatter, Result};
impl Display for Single {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {