/// <summary> /// Left移牌计算 /// </summary> /// <param name="list"></param> /// <returns></returns> public void LeftMoveMaJing() { moveStep--; if (moveStep < -15) { moveStep = 0; } txtMoveCount.text = "左移:" + Math.Abs(moveStep); LoopComputer.InverseMove(listMajiangAuto); LoadMaJing(majiangPlane); }
/// <summary> /// 右移移牌计算 /// </summary> /// <param name="list"></param> /// <returns></returns> public void RightMoveMaJing() { //移除所有 for (int i = 0; i < majiangPlane.transform.childCount; i++) { Destroy(majiangPlane.transform.GetChild(i).gameObject); } moveStep++; if (moveStep > 15 || moveStep < 0) { moveStep = 0; } txtMoveCount.text = "右移:" + moveStep; LoopComputer.ClockwiseeMove(listMajiangAuto); LoadMaJing(majiangPlane); }
public async Task Do() { #warning works if (!File.Exists(MapperDBFileName)) { using (_dBLayer = new DBLayer(MapperDBFileName)) await Task.Run(() => _osmOperations.ImportOSM(PDBFileName, _dBLayer, mapBoundingBox: _areaOfInterest)); } using (_dBLayer = new DBLayer(MapperDBFileName)) { #warning works //_osmOperations.SaveDBToShape(_dBLayer, GetFullFileName("test.shp")); #warning var nodesCache = _dBLayer.GetAllNodesDictionary(); LoopComputer loopComputer = new LoopComputer { MinLength = 2, Dal = _dBLayer }; loopComputer.NewLoop += (loop) => LoopComputer_NewLoop(nodesCache, loop); loopComputer.Compute(); } }
/// <summary> /// 左移算法 /// </summary> private string MoveComputer(string type, int dir) { List <Hashtable> oldList = null; List <Hashtable> result; List <List <Hashtable> > finalList = new List <List <Hashtable> >(); for (int num = 0; num < 1; num++) { switch (dir) { case 0: //右移 LoopComputer.ClockwiseeMove(listMajiangAuto); break; case 1: //左移 LoopComputer.InverseMove(listMajiangAuto); break; default: break; } switch (type) { case "SquatOut": //蹲出 oldList = SquatOut(majiangPlane); break; case "FlatOut": //蹲出 oldList = FlatOut(majiangPlane); break; case "JumpOut": //蹲出 oldList = JumpOut(majiangPlane); break; default: break; } result = MaJiang.Comparison(oldList); #if UNITY_EDITOR for (int i = 0; i < listMajiangAuto.Count - 2; i++) { //显示指定的牌 ShowContent.ChangValue(i, listMajiangAuto[i], majiangPlane); } #endif // ShowSort(oldList); List <Hashtable> resultList = AutoComputer(oldList, result, num, 1); finalList.Add(resultList); } Debug.Log(finalList.Count); string showValue = ""; int count = 0; foreach (var item in finalList) { string valueSort = ""; foreach (var table in item) { valueSort += table["Sorting"]; } string[] outDoor = dicResult["outDoor"]; foreach (var itemOutDoor in outDoor) { if (valueSort == itemOutDoor) { Debug.Log("出门" + valueSort); count++; showValue += MoveNum(valueSort + "->", count, "出门", dir); } } string[] endDoor = dicResult["endDoor"]; foreach (var itemEndDoor in endDoor) { if (valueSort == itemEndDoor) { Debug.Log("末门" + valueSort); count++; showValue += MoveNum(valueSort + "->", count, "末门", dir); } } string[] banker = dicResult["banker"]; foreach (var itemBanker in banker) { if (valueSort == itemBanker) { Debug.Log("庄家" + valueSort); count++; showValue += MoveNum(valueSort + "->", count, "庄家", dir); } } Debug.Log(valueSort); } return(showValue); }