import User from "../../../FrameWork/User/User" import Common5 from "../../../Platform/th/Common5" // import MeiNvZhaoMuManager, { ZhaoMuGameType } from "../../MeiNvZhaoMu/MeiNvZhaoMuManager" enum MaJiangType{ // CaiNiaoJu=0,//菜鸟局 // RuMenJu,//入门局 GaoShouJu,//高手局 } //1~9万 11~19筒 21~29条 51~57东南西北中发白 let MaJiangInitConfig = [ // {gameType:MaJiangType.CaiNiaoJu,shouYi:8000,jiangLi:80000,zhuangXiuFei:2000000,line:8,col:6,contentScale:1,typeData:[1,2,3,4,5,6,7,8,9,11,12,13]}, // {gameType:MaJiangType.RuMenJu,shouYi:12000,jiangLi:500000,zhuangXiuFei:6000000,line:10,col:8,contentScale:1,typeData:[1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,55,56]}, {gameType:MaJiangType.GaoShouJu,shouYi:16000,jiangLi:1000000,zhuangXiuFei:30000000,line:12,col:10,contentScale:0.8,typeData:[1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,55,56,57]}, ] export enum MoveDir{ None=0, Up, Down, Left, Right } export default class YiMaJiangManager{ public static initAllData(){ this.maJiangDataArr = [] this.moveTempMjDataArr = [] this.curMoveStep = -1 } public static singleMjWidth = 74 public static singleMjHeight = 82 public static maJiangDataArr = []//全部麻将数据 public static moveTempMjDataArr = []//移动时临时的全部麻将数据 public static curMoveStep = -1//记录当前移动步骤(移动时有变动才刷新data) public static curGameType = 0 public static setCurGameType(type){ this.curGameType = type } public static getCurGameType(){ return this.curGameType } public static touchStartInitData(){ this.moveTempMjDataArr = [] this.curMoveStep = -1 } public static getCurMoveStep(){ return this.curMoveStep } public static getMjConfig(){ return MaJiangInitConfig[this.curGameType] } public static getAllMjConfig(){ return MaJiangInitConfig } public static setMaJiangInitData(){ this.initAllData() let typeData = MaJiangInitConfig[this.curGameType].typeData let tempDataArr = [] for(let i=0;i=0;j--){ if(maJiangDataArr[posX][j] == 0 ){ continue }else if(maJiangDataArr[posX][j] == mjData){ return {posX:posX,posY:j} }else{ break } } //向右找 for(let j=posY+1;j=0;i--){ if(maJiangDataArr[i][posY] == 0 ){ continue }else if(maJiangDataArr[i][posY] == mjData){ return {posX:i,posY:posY} }else{ break } } //向下找 for(let i=posX+1;i=0;i--){ if(this.maJiangDataArr[i][posY] != 0 ){ if(!isFindKongGe){ canMoveMjData.push({posX:i,posY:posY}) }else{ isReFindMj = true } }else{ isFindKongGe = true if(!isReFindMj){ maxMoveStep++ } } } //往下 }else if(dir == MoveDir.Down){ for(let i=posX;i=0;j--){ if(this.maJiangDataArr[posX][j] != 0 ){ if(!isFindKongGe){ canMoveMjData.push({posX:posX,posY:j}) }else{ isReFindMj = true } }else{ isFindKongGe = true if(!isReFindMj){ maxMoveStep++ } } } //往右 }else if(dir == MoveDir.Right){ for(let j=posY;j