Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

41 řádky
1.1 KiB

  1. local ZPDef = ZPFramework.ZPImport("zp_base.luaScript.ZPDef")
  2. local DoushisiPokerUtil = {}
  3. function DoushisiPokerUtil.pokerParse( card )
  4. local tp = math.floor(card/16)
  5. local val = card%16
  6. -- print("---------tp : "..tp.." val : "..val)
  7. return tp, val
  8. end
  9. function DoushisiPokerUtil.pokerPng( card ,type)
  10. local tp , val = DoushisiPokerUtil.pokerParse(card)
  11. if type == ZPDef.CardType.CARD_TYPE_HAND then
  12. return string.format("dss_cards_%d_%d.png", tp, val)
  13. elseif type == ZPDef.CardType.CARD_TYPE_GROUP_OUT then
  14. return string.format("dss_out_cars_%d_%d.png", tp, val)
  15. elseif type == ZPDef.CardType.CARD_TYPE_HU then
  16. return string.format("dss_hu_cards_%d_%d.png", tp, val)
  17. end
  18. end
  19. -- ¶ÔÅÆ½øÐÐÅÅÐò
  20. function DoushisiPokerUtil.pokerSortDssCards( cards )
  21. local tmp = {}
  22. for _,card in ipairs(cards) do
  23. local tp, val = DoushisiPokerUtil.pokerParse(card)
  24. table.insert(tmp, {tp=tp, val=val, cid=card})
  25. end
  26. table.sort(tmp, function (a, b)
  27. if a.val == b.val then
  28. return a.tp < b.tp
  29. else
  30. return a.val < b.val
  31. end
  32. end)
  33. return tmp
  34. end
  35. return DoushisiPokerUtil