classifier: move hand types to their own module

This commit is contained in:
2026-04-01 05:42:16 +01:00
committed by oreodave
parent 04c39d4bae
commit 92348bc2c3
2 changed files with 29 additions and 27 deletions

View File

@@ -1,30 +1,5 @@
use crate::Card; use crate::card::{Card, Rank};
use crate::hand::{Hand, PokerType};
#[derive(Debug)]
pub enum PokerType {
TwoPair,
Flush,
Straight,
FullHouse,
FourKind,
FiveKind,
StraightFlush,
}
#[derive(Debug)]
pub enum Hand {
Single(Card),
Pair(Card, Card),
Triple(Card, Card, Card),
Poker {
poker_type: PokerType,
c1: Card,
c2: Card,
c3: Card,
c4: Card,
c5: Card,
},
}
impl Hand { impl Hand {
// Stupid shorthand method of generating poker hands // Stupid shorthand method of generating poker hands

27
src/hand.rs Normal file
View File

@@ -0,0 +1,27 @@
use crate::Card;
#[derive(Debug)]
pub enum PokerType {
TwoPair,
Flush,
Straight,
FullHouse,
FourKind,
FiveKind,
StraightFlush,
}
#[derive(Debug)]
pub enum Hand {
Single(Card),
Pair(Card, Card),
Triple(Card, Card, Card),
Poker {
poker_type: PokerType,
c1: Card,
c2: Card,
c3: Card,
c4: Card,
c5: Card,
},
}