use crate::SOK;
use crate::analysis::hand_rank::HandRankValue;
use serde::{Deserialize, Serialize};
use strum::EnumIter;

/// `HandRankClass` represents the more specific type of the five card `PokerHand`.
#[allow(clippy::module_name_repetitions)]
#[derive(Serialize, Deserialize, Clone, Copy, Debug, Default, EnumIter, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum HandRankClass {
    RoyalFlush,
    KingHighStraightFlush,
    QueenHighStraightFlush,
    JackHighStraightFlush,
    TenHighStraightFlush,
    NineHighStraightFlush,
    EightHighStraightFlush,
    SevenHighStraightFlush,
    SixHighStraightFlush,
    FiveHighStraightFlush,
    FourAces,
    FourKings,
    FourQueens,
    FourJacks,
    FourTens,
    FourNines,
    FourEights,
    FourSevens,
    FourSixes,
    FourFives,
    FourFours,
    FourTreys,
    FourDeuces,
    AcesOverKings,
    AcesOverQueens,
    AcesOverJacks,
    AcesOverTens,
    AcesOverNines,
    AcesOverEights,
    AcesOverSevens,
    AcesOverSixes,
    AcesOverFives,
    AcesOverFours,
    AcesOverTreys,
    AcesOverDeuces,
    KingsOverAces,
    KingsOverQueens,
    KingsOverJacks,
    KingsOverTens,
    KingsOverNines,
    KingsOverEights,
    KingsOverSevens,
    KingsOverSixes,
    KingsOverFives,
    KingsOverFours,
    KingsOverTreys,
    KingsOverDeuces,
    QueensOverAces,
    QueensOverKings,
    QueensOverJacks,
    QueensOverTens,
    QueensOverNines,
    QueensOverEights,
    QueensOverSevens,
    QueensOverSixes,
    QueensOverFives,
    QueensOverFours,
    QueensOverTreys,
    QueensOverDeuces,
    JacksOverAces,
    JacksOverKings,
    JacksOverQueens,
    JacksOverTens,
    JacksOverNines,
    JacksOverEights,
    JacksOverSevens,
    JacksOverSixes,
    JacksOverFives,
    JacksOverFours,
    JacksOverTreys,
    JacksOverDeuces,
    TensOverAces,
    TensOverKings,
    TensOverQueens,
    TensOverJacks,
    TensOverNines,
    TensOverEights,
    TensOverSevens,
    TensOverSixes,
    TensOverFives,
    TensOverFours,
    TensOverTreys,
    TensOverDeuces,
    NinesOverAces,
    NinesOverKings,
    NinesOverQueens,
    NinesOverJacks,
    NinesOverTens,
    NinesOverEights,
    NinesOverSevens,
    NinesOverSixes,
    NinesOverFives,
    NinesOverFours,
    NinesOverTreys,
    NinesOverDeuces,
    EightsOverAces,
    EightsOverKings,
    EightsOverQueens,
    EightsOverJacks,
    EightsOverTens,
    EightsOverNines,
    EightsOverSevens,
    EightsOverSixes,
    EightsOverFives,
    EightsOverFours,
    EightsOverTreys,
    EightsOverDeuces,
    SevensOverAces,
    SevensOverKings,
    SevensOverQueens,
    SevensOverJacks,
    SevensOverTens,
    SevensOverNines,
    SevensOverEights,
    SevensOverSixes,
    SevensOverFives,
    SevensOverFours,
    SevensOverTreys,
    SevensOverDeuces,
    SixesOverAces,
    SixesOverKings,
    SixesOverQueens,
    SixesOverJacks,
    SixesOverTens,
    SixesOverNines,
    SixesOverEights,
    SixesOverSevens,
    SixesOverFives,
    SixesOverFours,
    SixesOverTreys,
    SixesOverDeuces,
    FivesOverAces,
    FivesOverKings,
    FivesOverQueens,
    FivesOverJacks,
    FivesOverTens,
    FivesOverNines,
    FivesOverEights,
    FivesOverSevens,
    FivesOverSixes,
    FivesOverFours,
    FivesOverTreys,
    FivesOverDeuces,
    FoursOverAces,
    FoursOverKings,
    FoursOverQueens,
    FoursOverJacks,
    FoursOverTens,
    FoursOverNines,
    FoursOverEights,
    FoursOverSevens,
    FoursOverSixes,
    FoursOverFives,
    FoursOverTreys,
    FoursOverDeuces,
    TreysOverAces,
    TreysOverKings,
    TreysOverQueens,
    TreysOverJacks,
    TreysOverTens,
    TreysOverNines,
    TreysOverEights,
    TreysOverSevens,
    TreysOverSixes,
    TreysOverFives,
    TreysOverFours,
    TreysOverDeuces,
    DeucesOverAces,
    DeucesOverKings,
    DeucesOverQueens,
    DeucesOverJacks,
    DeucesOverTens,
    DeucesOverNines,
    DeucesOverEights,
    DeucesOverSevens,
    DeucesOverSixes,
    DeucesOverFives,
    DeucesOverFours,
    DeucesOverTreys,
    AceHighFlush,
    KingHighFlush,
    QueenHighFlush,
    JackHighFlush,
    TenHighFlush,
    NineHighFlush,
    EightHighFlush,
    SevenHighFlush,
    AceHighStraight,
    KingHighStraight,
    QueenHighStraight,
    JackHighStraight,
    TenHighStraight,
    NineHighStraight,
    EightHighStraight,
    SevenHighStraight,
    SixHighStraight,
    FiveHighStraight,
    ThreeAces,
    ThreeKings,
    ThreeQueens,
    ThreeJacks,
    ThreeTens,
    ThreeNines,
    ThreeEights,
    ThreeSevens,
    ThreeSixes,
    ThreeFives,
    ThreeFours,
    ThreeTreys,
    ThreeDeuces,
    AcesAndKings,
    AcesAndQueens,
    AcesAndJacks,
    AcesAndTens,
    AcesAndNines,
    AcesAndEights,
    AcesAndSevens,
    AcesAndSixes,
    AcesAndFives,
    AcesAndFours,
    AcesAndTreys,
    AcesAndDeuces,
    KingsAndQueens,
    KingsAndJacks,
    KingsAndTens,
    KingsAndNines,
    KingsAndEights,
    KingsAndSevens,
    KingsAndSixes,
    KingsAndFives,
    KingsAndFours,
    KingsAndTreys,
    KingsAndDeuces,
    QueensAndJacks,
    QueensAndTens,
    QueensAndNines,
    QueensAndEights,
    QueensAndSevens,
    QueensAndSixes,
    QueensAndFives,
    QueensAndFours,
    QueensAndTreys,
    QueensAndDeuces,
    JacksAndTens,
    JacksAndNines,
    JacksAndEights,
    JacksAndSevens,
    JacksAndSixes,
    JacksAndFives,
    JacksAndFours,
    JacksAndTreys,
    JacksAndDeuces,
    TensAndNines,
    TensAndEights,
    TensAndSevens,
    TensAndSixes,
    TensAndFives,
    TensAndFours,
    TensAndTreys,
    TensAndDeuces,
    NinesAndEights,
    NinesAndSevens,
    NinesAndSixes,
    NinesAndFives,
    NinesAndFours,
    NinesAndTreys,
    NinesAndDeuces,
    EightsAndSevens,
    EightsAndSixes,
    EightsAndFives,
    EightsAndFours,
    EightsAndTreys,
    EightsAndDeuces,
    SevensAndSixes,
    SevensAndFives,
    SevensAndFours,
    SevensAndTreys,
    SevensAndDeuces,
    SixesAndFives,
    SixesAndFours,
    SixesAndTreys,
    SixesAndDeuces,
    FivesAndFours,
    FivesAndTreys,
    FivesAndDeuces,
    FoursAndTreys,
    FoursAndDeuces,
    TreysAndDeuces,
    PairOfAces,
    PairOfKings,
    PairOfQueens,
    PairOfJacks,
    PairOfTens,
    PairOfNines,
    PairOfEights,
    PairOfSevens,
    PairOfSixes,
    PairOfFives,
    PairOfFours,
    PairOfTreys,
    PairOfDeuces,
    AceHigh,
    KingHigh,
    QueenHigh,
    JackHigh,
    TenHigh,
    NineHigh,
    EightHigh,
    SevenHigh,
    #[default]
    None,
}

#[allow(clippy::too_many_lines)]
impl From<HandRankValue> for HandRankClass {
    fn from(hrv: HandRankValue) -> Self {
        match hrv {
            1 => HandRankClass::RoyalFlush,
            2 => HandRankClass::KingHighStraightFlush,
            3 => HandRankClass::QueenHighStraightFlush,
            4 => HandRankClass::JackHighStraightFlush,
            5 => HandRankClass::TenHighStraightFlush,
            6 => HandRankClass::NineHighStraightFlush,
            7 => HandRankClass::EightHighStraightFlush,
            8 => HandRankClass::SevenHighStraightFlush,
            9 => HandRankClass::SixHighStraightFlush,
            10 => HandRankClass::FiveHighStraightFlush,
            11..=22 => HandRankClass::FourAces,
            23..=34 => HandRankClass::FourKings,
            35..=46 => HandRankClass::FourQueens,
            47..=58 => HandRankClass::FourJacks,
            59..=70 => HandRankClass::FourTens,
            71..=82 => HandRankClass::FourNines,
            83..=94 => HandRankClass::FourEights,
            95..=106 => HandRankClass::FourSevens,
            107..=118 => HandRankClass::FourSixes,
            119..=130 => HandRankClass::FourFives,
            131..=142 => HandRankClass::FourFours,
            143..=154 => HandRankClass::FourTreys,
            155..=166 => HandRankClass::FourDeuces,
            167 => HandRankClass::AcesOverKings,
            168 => HandRankClass::AcesOverQueens,
            169 => HandRankClass::AcesOverJacks,
            170 => HandRankClass::AcesOverTens,
            171 => HandRankClass::AcesOverNines,
            172 => HandRankClass::AcesOverEights,
            173 => HandRankClass::AcesOverSevens,
            174 => HandRankClass::AcesOverSixes,
            175 => HandRankClass::AcesOverFives,
            176 => HandRankClass::AcesOverFours,
            177 => HandRankClass::AcesOverTreys,
            178 => HandRankClass::AcesOverDeuces,
            179 => HandRankClass::KingsOverAces,
            180 => HandRankClass::KingsOverQueens,
            181 => HandRankClass::KingsOverJacks,
            182 => HandRankClass::KingsOverTens,
            183 => HandRankClass::KingsOverNines,
            184 => HandRankClass::KingsOverEights,
            185 => HandRankClass::KingsOverSevens,
            186 => HandRankClass::KingsOverSixes,
            187 => HandRankClass::KingsOverFives,
            188 => HandRankClass::KingsOverFours,
            189 => HandRankClass::KingsOverTreys,
            190 => HandRankClass::KingsOverDeuces,
            191 => HandRankClass::QueensOverAces,
            192 => HandRankClass::QueensOverKings,
            193 => HandRankClass::QueensOverJacks,
            194 => HandRankClass::QueensOverTens,
            195 => HandRankClass::QueensOverNines,
            196 => HandRankClass::QueensOverEights,
            197 => HandRankClass::QueensOverSevens,
            198 => HandRankClass::QueensOverSixes,
            199 => HandRankClass::QueensOverFives,
            200 => HandRankClass::QueensOverFours,
            201 => HandRankClass::QueensOverTreys,
            202 => HandRankClass::QueensOverDeuces,
            203 => HandRankClass::JacksOverAces,
            204 => HandRankClass::JacksOverKings,
            205 => HandRankClass::JacksOverQueens,
            206 => HandRankClass::JacksOverTens,
            207 => HandRankClass::JacksOverNines,
            208 => HandRankClass::JacksOverEights,
            209 => HandRankClass::JacksOverSevens,
            210 => HandRankClass::JacksOverSixes,
            211 => HandRankClass::JacksOverFives,
            212 => HandRankClass::JacksOverFours,
            213 => HandRankClass::JacksOverTreys,
            214 => HandRankClass::JacksOverDeuces,
            215 => HandRankClass::TensOverAces,
            216 => HandRankClass::TensOverKings,
            217 => HandRankClass::TensOverQueens,
            218 => HandRankClass::TensOverJacks,
            219 => HandRankClass::TensOverNines,
            220 => HandRankClass::TensOverEights,
            221 => HandRankClass::TensOverSevens,
            222 => HandRankClass::TensOverSixes,
            223 => HandRankClass::TensOverFives,
            224 => HandRankClass::TensOverFours,
            225 => HandRankClass::TensOverTreys,
            226 => HandRankClass::TensOverDeuces,
            227 => HandRankClass::NinesOverAces,
            228 => HandRankClass::NinesOverKings,
            229 => HandRankClass::NinesOverQueens,
            230 => HandRankClass::NinesOverJacks,
            231 => HandRankClass::NinesOverTens,
            232 => HandRankClass::NinesOverEights,
            233 => HandRankClass::NinesOverSevens,
            234 => HandRankClass::NinesOverSixes,
            235 => HandRankClass::NinesOverFives,
            236 => HandRankClass::NinesOverFours,
            237 => HandRankClass::NinesOverTreys,
            238 => HandRankClass::NinesOverDeuces,
            239 => HandRankClass::EightsOverAces,
            240 => HandRankClass::EightsOverKings,
            241 => HandRankClass::EightsOverQueens,
            242 => HandRankClass::EightsOverJacks,
            243 => HandRankClass::EightsOverTens,
            244 => HandRankClass::EightsOverNines,
            245 => HandRankClass::EightsOverSevens,
            246 => HandRankClass::EightsOverSixes,
            247 => HandRankClass::EightsOverFives,
            248 => HandRankClass::EightsOverFours,
            249 => HandRankClass::EightsOverTreys,
            250 => HandRankClass::EightsOverDeuces,
            251 => HandRankClass::SevensOverAces,
            252 => HandRankClass::SevensOverKings,
            253 => HandRankClass::SevensOverQueens,
            254 => HandRankClass::SevensOverJacks,
            255 => HandRankClass::SevensOverTens,
            256 => HandRankClass::SevensOverNines,
            257 => HandRankClass::SevensOverEights,
            258 => HandRankClass::SevensOverSixes,
            259 => HandRankClass::SevensOverFives,
            260 => HandRankClass::SevensOverFours,
            261 => HandRankClass::SevensOverTreys,
            262 => HandRankClass::SevensOverDeuces,
            263 => HandRankClass::SixesOverAces,
            264 => HandRankClass::SixesOverKings,
            265 => HandRankClass::SixesOverQueens,
            266 => HandRankClass::SixesOverJacks,
            267 => HandRankClass::SixesOverTens,
            268 => HandRankClass::SixesOverNines,
            269 => HandRankClass::SixesOverEights,
            270 => HandRankClass::SixesOverSevens,
            271 => HandRankClass::SixesOverFives,
            272 => HandRankClass::SixesOverFours,
            273 => HandRankClass::SixesOverTreys,
            274 => HandRankClass::SixesOverDeuces,
            275 => HandRankClass::FivesOverAces,
            276 => HandRankClass::FivesOverKings,
            277 => HandRankClass::FivesOverQueens,
            278 => HandRankClass::FivesOverJacks,
            279 => HandRankClass::FivesOverTens,
            280 => HandRankClass::FivesOverNines,
            281 => HandRankClass::FivesOverEights,
            282 => HandRankClass::FivesOverSevens,
            283 => HandRankClass::FivesOverSixes,
            284 => HandRankClass::FivesOverFours,
            285 => HandRankClass::FivesOverTreys,
            286 => HandRankClass::FivesOverDeuces,
            287 => HandRankClass::FoursOverAces,
            288 => HandRankClass::FoursOverKings,
            289 => HandRankClass::FoursOverQueens,
            290 => HandRankClass::FoursOverJacks,
            291 => HandRankClass::FoursOverTens,
            292 => HandRankClass::FoursOverNines,
            293 => HandRankClass::FoursOverEights,
            294 => HandRankClass::FoursOverSevens,
            295 => HandRankClass::FoursOverSixes,
            296 => HandRankClass::FoursOverFives,
            297 => HandRankClass::FoursOverTreys,
            298 => HandRankClass::FoursOverDeuces,
            299 => HandRankClass::TreysOverAces,
            300 => HandRankClass::TreysOverKings,
            301 => HandRankClass::TreysOverQueens,
            302 => HandRankClass::TreysOverJacks,
            303 => HandRankClass::TreysOverTens,
            304 => HandRankClass::TreysOverNines,
            305 => HandRankClass::TreysOverEights,
            306 => HandRankClass::TreysOverSevens,
            307 => HandRankClass::TreysOverSixes,
            308 => HandRankClass::TreysOverFives,
            309 => HandRankClass::TreysOverFours,
            310 => HandRankClass::TreysOverDeuces,
            311 => HandRankClass::DeucesOverAces,
            312 => HandRankClass::DeucesOverKings,
            313 => HandRankClass::DeucesOverQueens,
            314 => HandRankClass::DeucesOverJacks,
            315 => HandRankClass::DeucesOverTens,
            316 => HandRankClass::DeucesOverNines,
            317 => HandRankClass::DeucesOverEights,
            318 => HandRankClass::DeucesOverSevens,
            319 => HandRankClass::DeucesOverSixes,
            320 => HandRankClass::DeucesOverFives,
            321 => HandRankClass::DeucesOverFours,
            322 => HandRankClass::DeucesOverTreys,
            323..=815 => HandRankClass::AceHighFlush,
            816..=1144 => HandRankClass::KingHighFlush,
            1145..=1353 => HandRankClass::QueenHighFlush,
            1354..=1478 => HandRankClass::JackHighFlush,
            1479..=1547 => HandRankClass::TenHighFlush,
            1548..=1581 => HandRankClass::NineHighFlush,
            1582..=1595 => HandRankClass::EightHighFlush,
            1596..=1599 => HandRankClass::SevenHighFlush,
            1600 => HandRankClass::AceHighStraight,
            1601 => HandRankClass::KingHighStraight,
            1602 => HandRankClass::QueenHighStraight,
            1603 => HandRankClass::JackHighStraight,
            1604 => HandRankClass::TenHighStraight,
            1605 => HandRankClass::NineHighStraight,
            1606 => HandRankClass::EightHighStraight,
            1607 => HandRankClass::SevenHighStraight,
            1608 => HandRankClass::SixHighStraight,
            1609 => HandRankClass::FiveHighStraight,
            1610..=1675 => HandRankClass::ThreeAces,
            1676..=1741 => HandRankClass::ThreeKings,
            1742..=1807 => HandRankClass::ThreeQueens,
            1808..=1873 => HandRankClass::ThreeJacks,
            1874..=1939 => HandRankClass::ThreeTens,
            1940..=2005 => HandRankClass::ThreeNines,
            2006..=2071 => HandRankClass::ThreeEights,
            2072..=2137 => HandRankClass::ThreeSevens,
            2138..=2203 => HandRankClass::ThreeSixes,
            2204..=2269 => HandRankClass::ThreeFives,
            2270..=2335 => HandRankClass::ThreeFours,
            2336..=2401 => HandRankClass::ThreeTreys,
            2402..=2467 => HandRankClass::ThreeDeuces,
            2468..=2478 => HandRankClass::AcesAndKings,
            2479..=2489 => HandRankClass::AcesAndQueens,
            2490..=2500 => HandRankClass::AcesAndJacks,
            2501..=2511 => HandRankClass::AcesAndTens,
            2512..=2522 => HandRankClass::AcesAndNines,
            2523..=2533 => HandRankClass::AcesAndEights,
            2534..=2544 => HandRankClass::AcesAndSevens,
            2545..=2555 => HandRankClass::AcesAndSixes,
            2556..=2566 => HandRankClass::AcesAndFives,
            2567..=2577 => HandRankClass::AcesAndFours,
            2578..=2588 => HandRankClass::AcesAndTreys,
            2589..=2599 => HandRankClass::AcesAndDeuces,
            2600..=2610 => HandRankClass::KingsAndQueens,
            2611..=2621 => HandRankClass::KingsAndJacks,
            2622..=2632 => HandRankClass::KingsAndTens,
            2633..=2643 => HandRankClass::KingsAndNines,
            2644..=2654 => HandRankClass::KingsAndEights,
            2655..=2665 => HandRankClass::KingsAndSevens,
            2666..=2676 => HandRankClass::KingsAndSixes,
            2677..=2687 => HandRankClass::KingsAndFives,
            2688..=2698 => HandRankClass::KingsAndFours,
            2699..=2709 => HandRankClass::KingsAndTreys,
            2710..=2720 => HandRankClass::KingsAndDeuces,
            2721..=2731 => HandRankClass::QueensAndJacks,
            2732..=2742 => HandRankClass::QueensAndTens,
            2743..=2753 => HandRankClass::QueensAndNines,
            2754..=2764 => HandRankClass::QueensAndEights,
            2765..=2775 => HandRankClass::QueensAndSevens,
            2776..=2786 => HandRankClass::QueensAndSixes,
            2787..=2797 => HandRankClass::QueensAndFives,
            2798..=2808 => HandRankClass::QueensAndFours,
            2809..=2819 => HandRankClass::QueensAndTreys,
            2820..=2830 => HandRankClass::QueensAndDeuces,
            2831..=2841 => HandRankClass::JacksAndTens,
            2842..=2852 => HandRankClass::JacksAndNines,
            2853..=2863 => HandRankClass::JacksAndEights,
            2864..=2874 => HandRankClass::JacksAndSevens,
            2875..=2885 => HandRankClass::JacksAndSixes,
            2886..=2896 => HandRankClass::JacksAndFives,
            2897..=2907 => HandRankClass::JacksAndFours,
            2908..=2918 => HandRankClass::JacksAndTreys,
            2919..=2929 => HandRankClass::JacksAndDeuces,
            2930..=2940 => HandRankClass::TensAndNines,
            2941..=2951 => HandRankClass::TensAndEights,
            2952..=2962 => HandRankClass::TensAndSevens,
            2963..=2973 => HandRankClass::TensAndSixes,
            2974..=2984 => HandRankClass::TensAndFives,
            2985..=2995 => HandRankClass::TensAndFours,
            2996..=3006 => HandRankClass::TensAndTreys,
            3007..=3017 => HandRankClass::TensAndDeuces,
            3018..=3028 => HandRankClass::NinesAndEights,
            3029..=3039 => HandRankClass::NinesAndSevens,
            3040..=3050 => HandRankClass::NinesAndSixes,
            3051..=3061 => HandRankClass::NinesAndFives,
            3062..=3072 => HandRankClass::NinesAndFours,
            3073..=3083 => HandRankClass::NinesAndTreys,
            3084..=3094 => HandRankClass::NinesAndDeuces,
            3095..=3105 => HandRankClass::EightsAndSevens,
            3106..=3116 => HandRankClass::EightsAndSixes,
            3117..=3127 => HandRankClass::EightsAndFives,
            3128..=3138 => HandRankClass::EightsAndFours,
            3139..=3149 => HandRankClass::EightsAndTreys,
            3150..=3160 => HandRankClass::EightsAndDeuces,
            3161..=3171 => HandRankClass::SevensAndSixes,
            3172..=3182 => HandRankClass::SevensAndFives,
            3183..=3193 => HandRankClass::SevensAndFours,
            3194..=3204 => HandRankClass::SevensAndTreys,
            3205..=3215 => HandRankClass::SevensAndDeuces,
            3216..=3226 => HandRankClass::SixesAndFives,
            3227..=3237 => HandRankClass::SixesAndFours,
            3238..=3248 => HandRankClass::SixesAndTreys,
            3249..=3259 => HandRankClass::SixesAndDeuces,
            3260..=3270 => HandRankClass::FivesAndFours,
            3271..=3281 => HandRankClass::FivesAndTreys,
            3282..=3292 => HandRankClass::FivesAndDeuces,
            3293..=3303 => HandRankClass::FoursAndTreys,
            3304..=3314 => HandRankClass::FoursAndDeuces,
            3315..=3325 => HandRankClass::TreysAndDeuces,
            3326..=3545 => HandRankClass::PairOfAces,
            3546..=3765 => HandRankClass::PairOfKings,
            3766..=3985 => HandRankClass::PairOfQueens,
            3986..=4205 => HandRankClass::PairOfJacks,
            4206..=4425 => HandRankClass::PairOfTens,
            4426..=4645 => HandRankClass::PairOfNines,
            4646..=4865 => HandRankClass::PairOfEights,
            4866..=5085 => HandRankClass::PairOfSevens,
            5086..=5305 => HandRankClass::PairOfSixes,
            5306..=5525 => HandRankClass::PairOfFives,
            5526..=5745 => HandRankClass::PairOfFours,
            5746..=5965 => HandRankClass::PairOfTreys,
            5966..=6185 => HandRankClass::PairOfDeuces,
            6186..=6678 => HandRankClass::AceHigh,
            6679..=7007 => HandRankClass::KingHigh,
            7008..=7216 => HandRankClass::QueenHigh,
            7217..=7341 => HandRankClass::JackHigh,
            7342..=7410 => HandRankClass::TenHigh,
            7411..=7444 => HandRankClass::NineHigh,
            7445..=7458 => HandRankClass::EightHigh,
            7459..=7462 => HandRankClass::SevenHigh,
            _ => HandRankClass::None,
        }
    }
}

impl SOK for HandRankClass {
    fn salright(&self) -> bool {
        self != &HandRankClass::None
    }
}

#[cfg(test)]
#[allow(non_snake_case)]
mod hand_rank__class_tests {
    use super::*;

    #[test]
    fn salright() {
        assert!(HandRankClass::AcesOverQueens.salright());
        assert!(!HandRankClass::None.salright());
    }
}
