local ZPDef = ZPFramework.ZPImport("zp_base.luaScript.ZPDef") local DoushisiPokerUtil = {} function DoushisiPokerUtil.pokerParse( card ) local tp = math.floor(card/16) local val = card%16 -- print("---------tp : "..tp.." val : "..val) return tp, val end function DoushisiPokerUtil.pokerPng( card ,type) local tp , val = DoushisiPokerUtil.pokerParse(card) if type == ZPDef.CardType.CARD_TYPE_HAND then return string.format("dss_cards_%d_%d.png", tp, val) elseif type == ZPDef.CardType.CARD_TYPE_GROUP_OUT then return string.format("dss_out_cars_%d_%d.png", tp, val) elseif type == ZPDef.CardType.CARD_TYPE_HU then return string.format("dss_hu_cards_%d_%d.png", tp, val) end end -- ¶ÔÅÆ½øÐÐÅÅÐò function DoushisiPokerUtil.pokerSortDssCards( cards ) local tmp = {} for _,card in ipairs(cards) do local tp, val = DoushisiPokerUtil.pokerParse(card) table.insert(tmp, {tp=tp, val=val, cid=card}) end table.sort(tmp, function (a, b) if a.val == b.val then return a.tp < b.tp else return a.val < b.val end end) return tmp end return DoushisiPokerUtil