hengyang_client/lua_probject/extend_project/extend/poker2/suoha/ExPlayerPokerInfoView.lua

62 lines
1.3 KiB
Lua
Raw Normal View History

2025-05-07 10:29:37 +08:00
---
--- Created by 谌建军.
--- DateTime: 2017/12/13 16:35
---
2025-05-14 10:59:30 +08:00
local EXPlayerPokerInfoView = {
2025-05-07 10:29:37 +08:00
_view = nil,
_mainView = nil,
_mask_liangpai = nil,
}
2025-05-14 10:59:30 +08:00
local M = EXPlayerPokerInfoView
2025-05-07 10:29:37 +08:00
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)
2025-05-14 10:59:30 +08:00
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
2025-05-07 10:29:37 +08:00
end
function M:Clear()
self.hand_card_list:RemoveChildren(0, -1, true)
end
function M:Destroy()
end
return M