var GameProtocol = require("TrucoGameProtocol") var Global = require("Global"); cc.Class({ extends: cc.Component, properties: { }, statics: { analyzeData(m, s, dataview) { switch (s) { case GameProtocol.SUB_S_GAME_FREE: {//空闲状态 return this.analyze_GameFree(dataview); } case GameProtocol.SUB_S_GAME_START: {//游戏开始 return this.analyze_GameStart(dataview); } case GameProtocol.SUB_S_GAME_END: { //游戏结束 return this.analyze_GameEnd(dataview); } case GameProtocol.SUB_S_GAME_CONTINUE: { // return this.analyze_GameContinue(dataview); } case GameProtocol.SUB_S_OPERATE_FAIL: { //操作失败 return this.analyze_OperateFail(dataview); } case GameProtocol.SUB_S_TRUCO: { return this.analyze_GameTruco(dataview); } case GameProtocol.SUB_S_TRUCO_CHOOSE: { return this.analyze_GameTrucoChoose(dataview); } case GameProtocol.SUB_S_TRUCO_SET: { return this.analyze_TrucoSet(dataview); } case GameProtocol.SUB_S_COMPARE_CARD: { return this.analyze_CompareCard(dataview); } case GameProtocol.SUB_S_ROUND_START: { // return this.analyze_RoundStart(dataview); } case GameProtocol.SUB_S_OUT_CARD: { //玩家出牌 return this.analyze_OutCard(dataview); } case GameProtocol.SUB_S_WAIT_START:{//等待开始 return this.analyze_waitStart(dataview); } case GameProtocol.SUB_S_TRUSTEE_STATUS:{ return this.analyze_Trustee(dataview); } case GameProtocol.SUB_S_FORCE_LEAVE_CHOOSE:{ return this.analyze_ForceLeave(dataview); } case GameProtocol.SUB_S_CELL_SCORE:{ return this.analyze_CellScore(dataview); } case GameProtocol.SUB_S_FINAL_ROUND:{ return this.analyze_FinalRound(dataview); } case GameProtocol.SUB_S_FINAL_CHOOSE:{ return this.analyze_FinalChoose(dataview); } default: break; } return null; }, analyze_StatusFree:function(dataview) {//游戏状态free var dataList = {}; dataview.pos = 0; dataList.lCellScore = Global.GetInt32(dataview);//底分 return dataList; }, analyze_StatusPlay:function(dataview) {//游戏状态play var dataList = {}; dataview.pos = 0; dataList.lCellScore = Global.GetInt32(dataview);//底分 dataList.wCurrentUser = Global.GetInt16(dataview);//当前玩家 dataList.cbMagicShowCardData = Global.GetInt8(dataview);//明牌堆翻的第一张牌 dataList.cbMagicCardValue = Global.GetInt8(dataview);//明牌堆翻的第一张牌 dataList.cbCardCount = []; for(let i = 0;i