diff --git a/src/classifier.rs b/src/classifier.rs index 1382ee5..a608871 100644 --- a/src/classifier.rs +++ b/src/classifier.rs @@ -1,30 +1,5 @@ -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, - }, -} +use crate::card::{Card, Rank}; +use crate::hand::{Hand, PokerType}; impl Hand { // Stupid shorthand method of generating poker hands diff --git a/src/hand.rs b/src/hand.rs new file mode 100644 index 0000000..f03e9be --- /dev/null +++ b/src/hand.rs @@ -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, + }, +}