跑得快展示提示,修复少带不能出
parent
2370ea7783
commit
b502289a2a
|
|
@ -27,11 +27,12 @@ function M:initFlag()
|
|||
return self
|
||||
end
|
||||
|
||||
function M:initCards(cardList, flag)
|
||||
function M:initCards(cardList, flag, flag_allCards)
|
||||
print("lingmenginitCards")
|
||||
pt(cardList)
|
||||
local temp_long = 0
|
||||
self:Clear()
|
||||
self._flag_allCards = flag_allCards or false
|
||||
if flag then
|
||||
for i = 1, #cardList do
|
||||
local number = math.floor(cardList[i][1].card_code_number / 10)
|
||||
|
|
@ -78,26 +79,21 @@ function M:initCards(cardList, flag)
|
|||
end
|
||||
|
||||
function M:CheckCards()
|
||||
print("lingmengcheck1")
|
||||
if self:CheckAloneOrLong() then
|
||||
return true
|
||||
end
|
||||
print("lingmengcheck2")
|
||||
|
||||
if self:CheckDuiZi() then
|
||||
return true
|
||||
end
|
||||
print("lingmengcheck3")
|
||||
|
||||
if self:CheckSanDai() then
|
||||
return true
|
||||
end
|
||||
print("lingmengcheck4")
|
||||
|
||||
if self:CheckZha() then
|
||||
return true
|
||||
end
|
||||
print("lingmengcheck5")
|
||||
|
||||
return false
|
||||
end
|
||||
|
|
@ -142,9 +138,9 @@ function M:CheckSanDai()
|
|||
if self.threeNoBelt and self.cardNum == 3 and self.cardSize == 1 then
|
||||
return true
|
||||
end
|
||||
-- if self.threelack and self.cardNum == 4 and self.cardSize == 2 then
|
||||
-- return true
|
||||
-- end
|
||||
if self.threelack and self.cardNum == 4 and self.cardSize == 2 and self._flag_allCards then
|
||||
return true
|
||||
end
|
||||
|
||||
--飞机
|
||||
local temp_normol_feiji
|
||||
|
|
@ -201,27 +197,27 @@ function M:CheckSanDai()
|
|||
return true
|
||||
end
|
||||
|
||||
-- if self.threelack then
|
||||
-- local last_k
|
||||
-- local num_san = 0
|
||||
-- for k, v in pairs(self.cardList) do
|
||||
-- if v >= 3 then
|
||||
-- num_san = num_san + 1
|
||||
-- if not last_k then
|
||||
-- last_k = k
|
||||
-- else
|
||||
-- if math.abs(last_k - k) ~= 1 then
|
||||
-- return
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- if self.cardNum - num_san * 3 < num_san * 2 then
|
||||
-- return true
|
||||
-- else
|
||||
-- return
|
||||
-- end
|
||||
-- end
|
||||
if self.threelack and self._flag_allCards then
|
||||
local last_k
|
||||
local num_san = 0
|
||||
for k, v in pairs(self.cardList) do
|
||||
if v >= 3 then
|
||||
num_san = num_san + 1
|
||||
if not last_k then
|
||||
last_k = k
|
||||
else
|
||||
if math.abs(last_k - k) ~= 1 then
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if self.cardNum - num_san * 3 < num_san * 2 then
|
||||
return true
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function M:CheckZha()
|
||||
|
|
|
|||
|
|
@ -287,6 +287,34 @@ end
|
|||
function M:LoadConfigToDetail(data)
|
||||
local configData = json.decode(data)
|
||||
local returnString = string.format("人数%s人", configData.maxPlayers)
|
||||
if configData.rule then
|
||||
returnString = string.format("%s%s", returnString,
|
||||
configData.rule == 1 and ",黑桃三必出" or "")
|
||||
end
|
||||
if configData.showlength then
|
||||
-- returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
|
||||
end
|
||||
if configData.planeNoBelt then
|
||||
returnString = string.format("%s%s", returnString, configData.planeNoBelt == 0 and "" or ",飞机可不带")
|
||||
end
|
||||
if configData.threeNoBelt then
|
||||
returnString = string.format("%s%s", returnString, configData.threeNoBelt == 0 and "" or ",三张可不带")
|
||||
end
|
||||
if configData.planelack then
|
||||
returnString = string.format("%s%s", returnString, configData.planelack == 0 and "" or ",飞机可少带")
|
||||
end
|
||||
if configData.threelack then
|
||||
returnString = string.format("%s%s", returnString, configData.threelack == 0 and "" or ",三张可少带")
|
||||
end
|
||||
if configData.fourDaiThree then
|
||||
returnString = string.format("%s%s", returnString, configData.fourDaiThree and "" or ",四带三")
|
||||
end
|
||||
if configData.heartten then
|
||||
returnString = string.format("%s%s", returnString, configData.heartten == 1 and "" or ",红桃扎鸟")
|
||||
end
|
||||
if configData.specilAdd then
|
||||
returnString = string.format("%s%s", returnString, configData.specilAdd == 0 and "" or ",特殊加分")
|
||||
end
|
||||
return returnString
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -744,7 +744,8 @@ function M:TouchMoveEnd(context)
|
|||
|
||||
if #send_card > 0 then
|
||||
table.sort(send_card, tableSortNumber)
|
||||
self._cardCheck:initCards(#xuan_card > 0 and xuan_card or send_card, #xuan_card > 0)
|
||||
send_card = #xuan_card > 0 and xuan_card or send_card
|
||||
self._cardCheck:initCards(send_card, #xuan_card > 0, #send_card == self._view_handCard.numItems)
|
||||
self._ctr_canSendCard.selectedIndex = self._cardCheck:CheckCards() and 1 or 0
|
||||
else
|
||||
self._ctr_canSendCard.selectedIndex = 0
|
||||
|
|
|
|||
|
|
@ -171,9 +171,13 @@ function M:onTouchMove(context)
|
|||
end
|
||||
end
|
||||
else
|
||||
print("lingmengonTouchMove", chooseIndex, self._view_handCardList.numItems)
|
||||
|
||||
self.ischoose = true
|
||||
if self._view_handCardList.selectedIndex ~= chooseIndex then
|
||||
self:ChooseHand(chooseIndex)
|
||||
else
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue