Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

730 rindas
19 KiB

  1. local ZPDef = ZPFramework.ZPImport("zp_base.luaScript.ZPDef")
  2. local ZPFuc = ZPFramework.ZPImport("zp_base.luaScript.ZPFunctions")
  3. local ZPSound = ZPFramework.ZPImport("zp_base.luaScript.ZPSound")
  4. local ZPMessage = ZPFramework.ZPImport("zp_base.luaScript.Protocol.ZPMessage")
  5. local PokerUtil = require("zp_doushisi.luaScript.Views.Room.doushisiPokerUtil")
  6. local doushisiRoomOperationView = class("doushisiRoomOperationView", cc.UIView)
  7. function doushisiRoomOperationView:ctor()
  8. doushisiRoomOperationView.super.ctor(self);
  9. self.baOperate = nil
  10. self.touOperate = nil
  11. self.operationCardlist = {}
  12. self.isQiShou = false
  13. self.tishi = false
  14. self.outCard = 0 --点过的时候发过去的牌值
  15. end
  16. function doushisiRoomOperationView:onEnter()
  17. doushisiRoomOperationView.super.onEnter(self)
  18. self:bindEvent(app.room,"onHideOpreationView",handler(self,self.onHideOpreationView))
  19. local ui = loadUI("zp_doushisi/res/ui/ui_fangjian/doushisi_ui_operation.ui");
  20. self.ui = ui;
  21. self:addChild(ui);
  22. self.ui.Items.Button_Close:registerClick(function()
  23. self.ui.Items.Layout_operatorPanel:setVisible(true)
  24. self.ui.Items.Layout_Group:setVisible(false)
  25. end)
  26. --1吃 2碰 3过 4胡 5巴 6偷
  27. --吃牌只能拿自己手里的一张牌跟别人打出的牌或者摸到牌做组合
  28. --ui排序:吃碰胡过
  29. self.ui.Items.Button_1:registerClick(nil,function ()
  30. local function chi()
  31. local code = ZPDef.OpCode.OP_CHI
  32. if self:IsshowOpView(code) then
  33. self:showOperateView(code)
  34. else
  35. local card = self.operationCardlist[code][1]
  36. local oplist = {}
  37. table.insert(oplist,card)
  38. self:sendOperationCode(code,oplist)
  39. --直接隐藏界面
  40. self:setOperatorPanelView(false)
  41. end
  42. end
  43. local isHu = self:getIsHaveHuOp()
  44. if isHu == true then
  45. local content = string.format("确定放弃胡牌吗?")
  46. local okCallBack = function ()
  47. chi()
  48. end
  49. local cancelCallBack = function ()
  50. end
  51. showConfirmDialog(content,okCallBack,cancelCallBack)
  52. else
  53. chi()
  54. end
  55. end)
  56. self.ui.Items.Button_2:registerClick(function ()
  57. local function peng()
  58. local operateCode = ZPDef.OpCode.OP_PENG
  59. if self:IsshowOpView(operateCode) then
  60. self:showMoreCardOperateView(operateCode)
  61. else
  62. local card = self.operationCardlist[operateCode][1]
  63. self:sendOperationCode(operateCode,card)
  64. --直接隐藏界面
  65. self:setOperatorPanelView(false)
  66. end
  67. end
  68. local isHu = self:getIsHaveHuOp()
  69. if isHu == true then
  70. local content = string.format("确定放弃胡牌吗?")
  71. local okCallBack = function ()
  72. peng()
  73. end
  74. local cancelCallBack = function ()
  75. end
  76. showConfirmDialog(content,okCallBack,cancelCallBack)
  77. else
  78. peng()
  79. end
  80. end)
  81. --[[ --癞子碰
  82. self.ui.Items.Button_9:registerClick(function ()
  83. local function peng()
  84. local operateCode = ZPDef.OpCode.OP_PENG_LAIZI
  85. if self:IsshowOpView(operateCode) then
  86. self:showMoreCardOperateView(operateCode)
  87. else
  88. local card = self.operationCardlist[operateCode][1]
  89. self:sendOperationCode(operateCode,card)
  90. --直接隐藏界面
  91. self:setOperatorPanelView(false)
  92. end
  93. end
  94. local isHu = self:getIsHaveHuOp()
  95. if isHu == true then
  96. local content = string.format("确定放弃胡牌吗?")
  97. local okCallBack = function ()
  98. peng()
  99. end
  100. local cancelCallBack = function ()
  101. end
  102. showConfirmDialog(content,okCallBack,cancelCallBack)
  103. else
  104. peng()
  105. end
  106. end)--]]
  107. --self:hidePengBtn()
  108. self.ui.Items.Button_3:registerClick(function ()
  109. if app.room:isLittleFamily() then return end
  110. local isHu = self:getIsHaveHuOp()
  111. if isHu == true then
  112. local content = string.format("确定放弃胡牌吗?")
  113. local okCallBack = function ()
  114. self:onClickGuo()
  115. end
  116. local cancelCallBack = function ()
  117. end
  118. showConfirmDialog(content,okCallBack,cancelCallBack)
  119. else
  120. self:onClickGuo()
  121. end
  122. end)
  123. self.ui.Items.Button_4:registerClick(function ()
  124. local operateCode = 0
  125. operateCode = ZPDef.OpCode.OP_HU
  126. local retHu = bit32.band(self.operationLocalCode,ZPDef.OpCode.OP_HU)
  127. if retHu > 0 then
  128. operateCode = ZPDef.OpCode.OP_HU
  129. else
  130. operateCode = ZPDef.OpCode.OP_TIAN_HU
  131. end
  132. local card = 0
  133. if not self.isQiShou then
  134. card = self.operationCardlist[ZPDef.OpCode.OP_HU][1]
  135. end
  136. local oplist = {}
  137. table.insert(oplist,card)
  138. self:sendOperationCode(operateCode,oplist)
  139. self:setOperatorPanelView(false)
  140. end)
  141. --巴牌
  142. self.ui.Items.Button_5:registerClick(function ()
  143. local function ba()
  144. if self:IsshowOpView(self.baOperate) then
  145. self:showOperateView(self.baOperate)
  146. else
  147. local operateCode = 0
  148. operateCode = self.baOperate
  149. local card = self.operationCardlist[self.baOperate][1]
  150. local oplist = {}
  151. table.insert(oplist,card)
  152. self:sendOperationCode(operateCode,oplist)
  153. --直接隐藏界面
  154. self:setOperatorPanelView(false)
  155. end
  156. end
  157. local isHu = self:getIsHaveHuOp()
  158. if isHu == true then
  159. local content = string.format("确定放弃胡牌吗?")
  160. local okCallBack = function ()
  161. ba()
  162. end
  163. local cancelCallBack = function ()
  164. end
  165. showConfirmDialog(content,okCallBack,cancelCallBack)
  166. else
  167. ba()
  168. end
  169. end)
  170. --偷牌
  171. self.ui.Items.Button_6:registerClick(function ()
  172. local function tou()
  173. if self:IsshowOpView(self.touOperate) then
  174. self:showMoreCardOperateView(self.touOperate)
  175. else
  176. local operateCode = 0
  177. operateCode = self.touOperate
  178. local card = self.operationCardlist[self.touOperate][1]
  179. self:sendOperationCode(operateCode,card)
  180. --直接隐藏界面
  181. self:setOperatorPanelView(false)
  182. end
  183. end
  184. local isHu = self:getIsHaveHuOp()
  185. if isHu == true then
  186. local content = string.format("确定放弃胡牌吗?")
  187. local okCallBack = function ()
  188. tou()
  189. end
  190. local cancelCallBack = function ()
  191. end
  192. showConfirmDialog(content,okCallBack,cancelCallBack)
  193. else
  194. tou()
  195. end
  196. end)
  197. self.ui.Items.Button_7:registerClick(function ()
  198. if app.room:isLittleFamily() then return end
  199. local request = ZPMessage.BaoPai:new()
  200. request.optType = 1
  201. logE("doushisiRoomOperationView:baojiao"..table.tostring(request))
  202. self.ui:sendMsg(app.room, "BaoPai", request, function(status, response)
  203. logE("doushisiRoomOperationView baojiao response = ", table.tostring(response))
  204. end)
  205. self:showBaoPaiOpView(false)
  206. end)
  207. self.ui.Items.Button_8:registerClick(function ()
  208. if app.room:isLittleFamily() then return end
  209. local request = ZPMessage.BaoPai:new()
  210. request.optType = 0
  211. logE("doushisiRoomOperationView:baojiao"..table.tostring(request))
  212. self.ui:sendMsg(app.room, "BaoPai", request, function(status, response)
  213. logE("doushisiRoomOperationView baojiao response = ", table.tostring(response))
  214. end)
  215. self:showBaoPaiOpView(false)
  216. end)
  217. self:hideSelf()
  218. end
  219. function doushisiRoomOperationView:onHideOpreationView()
  220. self.tishi = false
  221. self:setOperatorPanelView(false)
  222. end
  223. --是否需要展示操作界面
  224. function doushisiRoomOperationView:IsshowOpView(op)
  225. local cardlist = {}
  226. if op then
  227. cardlist = self.operationCardlist[op]
  228. end
  229. if #cardlist > 1 then
  230. return true
  231. end
  232. return false
  233. end
  234. function doushisiRoomOperationView:loadImageType(op)
  235. local retBa1 = bit32.band(op,ZPDef.OpCode.OP_BA_QI_SHOU)
  236. local retBa2 = bit32.band(op,ZPDef.OpCode.OP_BA_ZHUA)
  237. local retBa3 = bit32.band(op,ZPDef.OpCode.OP_BA_FAN)
  238. if retBa3 > 0 or retBa1 > 0 or retBa2 > 0 then
  239. self.ui.Items.ImageView_Op:loadTexture("zp_doushisi/res/ui/zy_fangjian/opeate_ba.png")
  240. end
  241. local retTou4 = bit32.band(op,ZPDef.OpCode.OP_TOU_QI_SHOU)
  242. local retTou5 = bit32.band(op,ZPDef.OpCode.OP_TOU_ZHUA)
  243. if retTou4 > 0 or retTou5 > 0 then
  244. self.ui.Items.ImageView_Op:loadTexture("zp_doushisi/res/ui/zy_fangjian/opeate_tou.png")
  245. end
  246. local retChi = bit32.band(op,ZPDef.OpCode.OP_CHI)
  247. if retChi > 0 then
  248. self.ui.Items.ImageView_Op:loadTexture("zp_doushisi/res/ui/zy_fangjian/opeate_chi.png")
  249. end
  250. local retPeng = bit32.band(op,ZPDef.OpCode.OP_PENG)
  251. if retPeng > 0 then
  252. self.ui.Items.ImageView_Op:loadTexture("zp_doushisi/res/ui/zy_fangjian/opeate_peng.png")
  253. end
  254. end
  255. --如果有多张牌时,展示操作界面 --吃的时候发一张牌
  256. function doushisiRoomOperationView:showOperateView(op)
  257. self.ui.Items.Layout_operatorPanel:setVisible(false)
  258. self.ui.Items.Layout_Group:setVisible(true)
  259. self.ui.Items.Layout_12:removeAllChildren()
  260. self:loadImageType(op)
  261. local cardlist = self.operationCardlist[op]
  262. for k,v in ipairs(cardlist) do
  263. local uiTemplate = self.ui.Items.Layout_opCard
  264. local uiItem = uiTemplate:getCopied()
  265. uiItem.Items = getUIItems(uiItem)
  266. local fileName = PokerUtil.pokerPng(v,ZPDef.CardType.CARD_TYPE_GROUP_OUT)
  267. for i = 1, 3 do
  268. local imageNode = string.format("ImageView_card_%d",i)
  269. uiItem.Items[imageNode]:setVisible(false)
  270. end
  271. uiItem.Items.ImageView_card_2:setVisible(true)
  272. uiItem.Items.ImageView_card_2:loadTextureFromPlist(fileName)
  273. uiItem.Items.Layout_opCard:registerClick(function()
  274. local operateCode = 0
  275. operateCode = op
  276. local card = v
  277. local oplist = {}
  278. table.insert(oplist,card)
  279. self:sendOperationCode(operateCode,oplist)
  280. --直接隐藏界面
  281. self:hideSelf()
  282. end)
  283. self.ui.Items.Layout_12:addChild(uiItem)
  284. end
  285. self.ui.Items.Layout_12:requestDoLayout()
  286. self.ui.Items.Layout_12:doLayout();
  287. self.ui.Items.Layout_Group:requestDoLayout()
  288. self.ui.Items.Layout_Group:doLayout()
  289. end
  290. --如果有多张牌时,展示操作界面 --其他时候发多张牌
  291. function doushisiRoomOperationView:showMoreCardOperateView(op)
  292. self.ui.Items.Layout_operatorPanel:setVisible(false)
  293. self.ui.Items.Layout_Group:setVisible(true)
  294. self.ui.Items.Layout_12:removeAllChildren()
  295. self:loadImageType(op)
  296. local cardlist = self.operationCardlist[op]
  297. local resultGroupList = {}
  298. for k,cards in pairs(cardlist) do
  299. local list = PokerUtil.pokerSortDssCards(cards)
  300. table.insert(resultGroupList,list)
  301. end
  302. table.sort(resultGroupList, function (a, b)
  303. if a[1].val == b[1].val then
  304. return a[1].tp < b[1].tp
  305. else
  306. return a[1].val < b[1].val
  307. end
  308. end)
  309. local tempCarlist = {}
  310. local cardData = {}
  311. for i = 1,#resultGroupList do
  312. local list = resultGroupList[i]
  313. cardData = {}
  314. for i = 1, #list do
  315. local card = list[i].cid
  316. table.insert(cardData,card)
  317. end
  318. table.insert(tempCarlist,cardData)
  319. end
  320. for k,v in ipairs(tempCarlist) do
  321. local uiTemplate = self.ui.Items.Layout_opCard
  322. local uiItem = uiTemplate:getCopied()
  323. uiItem.Items = getUIItems(uiItem)
  324. for i = 1, 3 do
  325. local imageNode = string.format("ImageView_card_%d",i)
  326. uiItem.Items[imageNode]:setVisible(false)
  327. end
  328. local oplist = {}
  329. for _,val in pairs(v or {}) do
  330. table.insert(oplist,val)
  331. end
  332. table.sort(oplist,function(a,b)
  333. return a > b
  334. end)
  335. local lens = table.nums(oplist)
  336. for i = 1,lens do
  337. local imageNode = string.format("ImageView_card_%d",i)
  338. uiItem.Items[imageNode]:setVisible(true)
  339. local fileName = PokerUtil.pokerPng(oplist[i],ZPDef.CardType.CARD_TYPE_GROUP_OUT)
  340. uiItem.Items[imageNode]:loadTextureFromPlist(fileName)
  341. end
  342. uiItem.Items.Layout_opCard:registerClick(function()
  343. local operateCode = 0
  344. operateCode = op
  345. local card = v
  346. local oplist = {}
  347. for _,val in pairs(card or {}) do
  348. table.insert(oplist,val)
  349. end
  350. self:sendOperationCode(operateCode,oplist)
  351. --直接隐藏界面
  352. self:hideSelf()
  353. end)
  354. self.ui.Items.Layout_12:addChild(uiItem)
  355. end
  356. self.ui.Items.Layout_12:requestDoLayout()
  357. self.ui.Items.Layout_12:doLayout();
  358. self.ui.Items.Layout_Group:requestDoLayout()
  359. self.ui.Items.Layout_Group:doLayout()
  360. end
  361. --获取是否有胡操作
  362. function doushisiRoomOperationView:getIsHaveHuOp()
  363. if not self.operationLocalCode then return false end
  364. local beginList = {}
  365. beginList = ZPFuc.getZPOperationType(self.operationLocalCode,true)
  366. local isHu = false
  367. for k,opType in pairs(beginList) do
  368. if opType == ZPDef.OpType.OP_TYPE_HU then
  369. isHu = true
  370. break
  371. end
  372. end
  373. return isHu
  374. end
  375. --泸州大贰自动碰,所以隐藏碰按钮
  376. function doushisiRoomOperationView:hidePengBtn()
  377. end
  378. function doushisiRoomOperationView:showOperation(mainOpCode,card,isQiShou,hasGuo,isTishi)
  379. if app.room:isLittleFamily() then return end
  380. --操作码
  381. self.operationLocalCode = mainOpCode
  382. --获取偷巴操作
  383. self.touOperate = self:getTouOperate(self.operationLocalCode)
  384. self.baOperate = self:getBaOperate(self.operationLocalCode)
  385. --可以操作的牌
  386. self.operationCardlist = card
  387. --是否是起手操作
  388. self.isQiShou = isQiShou
  389. logE("RoomView:showOperation(mainOpCode) 1:"..mainOpCode)
  390. self.tishi = isTishi
  391. --操作类型
  392. local beginList = {}
  393. beginList = ZPFuc.getZPOperationType(mainOpCode,hasGuo)--,self.playerZhao[1] > 0
  394. logE("RoomView:showOperation isCheckMustOperation before (beginList)1 :"..table.tostring(beginList))
  395. --胡牌优先规则
  396. local isHu = false
  397. for k,opType in pairs(beginList) do
  398. if opType == ZPDef.OpType.OP_TYPE_HU then
  399. isHu = true
  400. break
  401. end
  402. end
  403. --如果没有胡,扫,提,跑,等自动操作,则显示吃碰过操作
  404. self:setOperatorPanelView(true,beginList)
  405. end
  406. --隐藏行为操作层
  407. function doushisiRoomOperationView:setOperatorPanelView(bVisible,operations)
  408. self:setVisible(bVisible)
  409. self.ui.Items.Layout_operatorPanel:setVisible(bVisible)
  410. --置灰所有 ui排序:吃碰过
  411. for i = 1 ,8 do
  412. local name = string.format("Button_%d",i)
  413. if self.ui.Items[name] then
  414. self.ui.Items[name]:setVisible(false)
  415. end
  416. end
  417. local index = 1
  418. local guoPosx = self.ui.Items.Layout_3:getPositionX()
  419. --显示操作序列
  420. if operations then
  421. for k,v in pairs(operations) do
  422. local name = string.format("Button_%d",v)
  423. local layout = string.format("Layout_%d",v)
  424. --偷和巴做特殊判断
  425. if v == 12 or v == 15 then
  426. name = string.format("Button_%d",5)
  427. layout = string.format("Layout_%d",5)
  428. elseif v == 13 then
  429. name = string.format("Button_%d",6)
  430. layout = string.format("Layout_%d",6)
  431. end
  432. if self.ui.Items[name] then
  433. self.ui.Items[name]:setEnabled(true)
  434. self.ui.Items[name]:setVisible(true)
  435. if v ~= 3 then
  436. self.ui.Items[layout]:setPositionX(guoPosx - index*161)
  437. index = index + 1
  438. end
  439. end
  440. end
  441. end
  442. end
  443. function doushisiRoomOperationView:getTouOperate(op)
  444. local opreate = nil
  445. local ret1 = bit32.band(op,ZPDef.OpCode.OP_TOU_QI_SHOU)
  446. if ret1 > 0 then
  447. return ZPDef.OpCode.OP_TOU_QI_SHOU
  448. end
  449. local ret2 = bit32.band(op,ZPDef.OpCode.OP_TOU_ZHUA)
  450. if ret2 > 0 then
  451. return ZPDef.OpCode.OP_TOU_ZHUA
  452. end
  453. return opreate
  454. end
  455. function doushisiRoomOperationView:getBaOperate(op)
  456. local opreate = nil
  457. local ret1 = bit32.band(op,ZPDef.OpCode.OP_BA_QI_SHOU)
  458. if ret1 > 0 then
  459. return ZPDef.OpCode.OP_BA_QI_SHOU
  460. end
  461. local ret2 = bit32.band(op,ZPDef.OpCode.OP_BA_ZHUA)
  462. if ret2 > 0 then
  463. return ZPDef.OpCode.OP_BA_ZHUA
  464. end
  465. local ret3 = bit32.band(op,ZPDef.OpCode.OP_BA_FAN)
  466. if ret3 > 0 then
  467. return ZPDef.OpCode.OP_BA_FAN
  468. end
  469. return opreate
  470. end
  471. --显示爆牌操作
  472. function doushisiRoomOperationView:showBaoPaiOpView(isshow)
  473. if app.room:isLittleFamily() then return end
  474. self:setVisible(isshow)
  475. if true == isshow then
  476. local operations = {}
  477. table.insert(operations,8)
  478. table.insert(operations,7)
  479. self:setOperatorPanelView(isshow,operations)
  480. else
  481. self:setOperatorPanelView(false)
  482. end
  483. end
  484. --隐藏自身
  485. function doushisiRoomOperationView:hideSelf()
  486. self.ui.Items.Layout_operatorPanel:setVisible(false)
  487. self.ui.Items.Layout_Group:setVisible(false)
  488. end
  489. function doushisiRoomOperationView:sendOperationCode(operationCode,oplist)
  490. if app.room:isLittleFamily() then return end
  491. local oplist = oplist or {}
  492. local ishasLaizi = false
  493. for _,v in pairs(oplist) do
  494. if v > 0x50 then
  495. ishasLaizi = true
  496. break
  497. end
  498. end
  499. if ishasLaizi and operationCode == ZPDef.OpCode.OP_PENG then
  500. operationCode = ZPDef.OpCode.OP_PENG_LAIZI
  501. end
  502. if self.isQiShou then
  503. local request = ZPMessage.GameQiShouSendOperateCodeResponse:new()
  504. request.operateCode = operationCode
  505. for _,v in pairs(oplist) do
  506. table.insert(request.opCard.Datas, v)
  507. end
  508. logE("sendQiShouOperate:"..table.tostring(request))
  509. self.ui:sendMsg(app.room, "sendQiShouOperate", request, function(status, response)
  510. logE("RoomView sendQiShouOperate() response = ", table.tostring(response))
  511. end)
  512. else
  513. local request = ZPMessage.GameSendOpCodeResponse:new()
  514. --发送操作码
  515. request.operateCode = operationCode
  516. for _,v in pairs(oplist) do
  517. table.insert(request.opCard.Datas, v)
  518. end
  519. logE("sendOperationCode:"..table.tostring(request))
  520. self.ui:sendMsg(app.room, "sendOperationCode", request, function(status, response)
  521. logE("RoomView sendOperationCode() response = ", table.tostring(response))
  522. end)
  523. end
  524. app:dispatchEvent({name = "onClickOpBtn"});
  525. end
  526. function doushisiRoomOperationView:onClickGuo()
  527. --算法保留,现在是强制胡牌,如果是非强制胡牌的规则,这里就起作用了
  528. --操作类型
  529. local beginList = {}
  530. beginList = ZPFuc.getZPOperationType(self.operationLocalCode,true)--,self.playerZhao[1] > 0
  531. local isHu = false
  532. for k,opType in pairs(beginList) do
  533. if opType == ZPDef.OpType.OP_TYPE_HU then
  534. isHu = true
  535. break
  536. end
  537. end
  538. if self.tishi then
  539. local view = import("zp_doushisi.luaScript.Views.Room.doushisiRoomBaoPei"):new(nil,1)
  540. view:setAnchorPoint(cc.p(0.5, 0.5))
  541. app:showWaitDialog(view)
  542. else
  543. local operateCode = 0
  544. operateCode = ZPDef.OpCode.OP_CANCEL
  545. local oplist = {}
  546. table.insert(oplist,self.outCard)
  547. self:sendOperationCode(operateCode,oplist)
  548. --直接隐藏界面
  549. self:setOperatorPanelView(false)
  550. --如果有吃的界面则隐藏
  551. self:setEatCardView(false)
  552. local nUserID = app.room:getUserIdByViewId(1)
  553. end
  554. --playVoiceOperation(ZPDef.OpType.OP_TYPE_CANCEL,nUserID)
  555. end
  556. --隐藏吃牌界面
  557. function doushisiRoomOperationView:setEatCardView(bVisible)
  558. self.ui.Items.Layout_Group:setVisible(bVisible)
  559. self.ui.Items.Layout_12:removeAllChildren()
  560. end
  561. --隐藏比牌界面
  562. function doushisiRoomOperationView:setEatCardBiView(bVisible)
  563. end
  564. --隐藏比牌界面
  565. function doushisiRoomOperationView:setEatCardSanBiView(bVisible)
  566. end
  567. function doushisiRoomOperationView:setAllEatView(bVisible)
  568. end
  569. --吃牌点击
  570. function doushisiRoomOperationView:touchEatOneCardCallBack()
  571. end
  572. --点击吃牌组合牌一回调
  573. function doushisiRoomOperationView:touchEatTwoCardCallBack(operateCode,weaveCardList)
  574. end
  575. --点击吃牌组合牌一回调
  576. function doushisiRoomOperationView:touchEatSanCardCallBack(operateCode1,weaveCardList1,operateCode2,weaveCardList2)
  577. end
  578. --判断能否吃牌
  579. --[[
  580. operateCode:吃牌操作码
  581. list : 吃牌组合,key为操作码,value为三张牌组合
  582. index :list的有效大小
  583. ]]
  584. function doushisiRoomOperationView:getEatLeaveWeave(handCardValueLocalTemp)
  585. end
  586. --判断能否吃牌
  587. --[[
  588. weaveCard:要吃的那组牌
  589. handCardValueLocalTemp:剩下的手牌(已经假定删掉吃过的牌)
  590. ]]
  591. function doushisiRoomOperationView:eatCardLogic(weaveCard,handCardValueLocalTemp)
  592. end
  593. --多维数组转 一维数组
  594. function doushisiRoomOperationView:ChangeDataToVector(data)
  595. local tt = {}
  596. for i = 1, self.lieShuMax do
  597. for j = 1, self.hangShuMax do
  598. if data[i][j] then
  599. table.insert(tt,data[i][j])
  600. end
  601. end
  602. end
  603. return tt
  604. end
  605. --[[
  606. 吃牌优化:优先显示油数的组合
  607. ]]
  608. function doushisiRoomOperationView:RankChiPai(weaveCardList,listCode)
  609. end
  610. --游戏场景传一些参数过来 出的牌,手牌数据
  611. function doushisiRoomOperationView:setSameParame(outCard,handCardList)
  612. self.outCard = outCard
  613. self.handCardValueLocal = handCardList
  614. end
  615. return doushisiRoomOperationView;