/**
 * 牌型大小比较工具类
 */ class PukerCompareUtils { public constructor ( ) { } /**
     * 比较两手牌的大小
     * a b ,当a大于b时返回true
     * 王炸通吃
     * 炸弹仅次于王炸
     * 其他牌必须牌型相等才能比较
     */ public static comparePukers ( a , b ) { let aSort = PukerUtils . sortDescPokers ( a ) ; let bSort = PukerUtils . sortDescPokers ( b ) ; if ( aSort . length < 1 || bSort . length < 1 ) return false ; if ( PukerTypeUtils . isKingBoom ( bSort ) != - 1 ) return false ; if ( PukerTypeUtils . isKingBoom ( aSort ) != - 1 ) return true ; if ( PukerTypeUtils . isBoom ( bSort ) != - 1 ) { if ( PukerTypeUtils . isBoom ( aSort ) != - 1 ) return this . compareOne ( aSort [ 0 ] , bSort [ 0 ] ) ; return false ; } if ( PukerTypeUtils . isBoom ( aSort ) != - 1 ) return true ; if ( a . length != b . length ) return false ; let aType = PukerTypeUtils . getType ( aSort ) ; let bType = PukerTypeUtils . getType ( bSort ) ; if ( aType == null || bType == null || aType . getType ( ) != bType . getType ( ) ) return false ; return aType . getSort ( ) > bType . getSort ( ) ; } /**
     * 比较单牌的大小
     */ private static compareOne ( a , b ) { if ( a . getOrderValue ( ) > b . getOrderValue ( ) ) { return true ; } else { return false ; } } }