62 lines
1.3 KiB
Lua
62 lines
1.3 KiB
Lua
---
|
|
--- Created by 谌建军.
|
|
--- DateTime: 2017/12/13 16:35
|
|
---
|
|
local EXPlayerPokerInfoView = {
|
|
_view = nil,
|
|
_mainView = nil,
|
|
_mask_liangpai = nil,
|
|
}
|
|
|
|
local M = EXPlayerPokerInfoView
|
|
|
|
function M.new(view, mainView)
|
|
local self = {}
|
|
setmetatable(self, { __index = M })
|
|
self._view = view
|
|
self._mainView = mainView
|
|
self:init()
|
|
return self
|
|
end
|
|
|
|
function M:init()
|
|
local view = self._view
|
|
self._gameCtr = ControllerManager.GetController(GameController)
|
|
|
|
self._view_handCardList = view:GetChild('list_handCard')
|
|
end
|
|
|
|
function M:UpdateHandPoker(cardList)
|
|
|
|
end
|
|
|
|
function M:FillPoker(poker2, prefix, num, code)
|
|
if num ~= nil then
|
|
code = self:ChangeCodeByTo(num)
|
|
end
|
|
code = code == 1 and "00" or code
|
|
if not poker2.icon then
|
|
poker2:GetChild('icon').url = string.format("ui://Extend_Poker_SuoHa/%s%s", prefix, code)
|
|
else
|
|
poker2.icon = string.format("ui://Extend_Poker_SuoHa/%s%s", prefix, code)
|
|
end
|
|
end
|
|
|
|
function M:ChangeCodeByTo(card)
|
|
local flower = card % 10
|
|
local number = math.floor(card / 10)
|
|
if number == 15 then
|
|
number = 2
|
|
end
|
|
return flower * 100 + number
|
|
end
|
|
|
|
function M:Clear()
|
|
self.hand_card_list:RemoveChildren(0, -1, true)
|
|
end
|
|
|
|
function M:Destroy()
|
|
end
|
|
|
|
return M
|