Trait onejoker::poker::hand_value::HandLevelTrait
source · pub trait HandLevelTrait: Copy {
// Required methods
fn index(&self) -> u32;
fn from_index(i: u32) -> Self;
fn best() -> Self;
fn worst() -> Self;
}
Expand description
wiki | Base class for categories of poker hands.
Poker hands are ranked by first grouping them into categories (which here we call “level”), and then comparing the ranks of the cards within that level to break ties. We use the actual numbers here for calculating comparators, and comparators are valued such that lower numbers mean better hands.
Required Methods§
sourcefn from_index(i: u32) -> Self
fn from_index(i: u32) -> Self
Convert an integer index to a level.
Object Safety§
This trait is not object safe.