/// <summary> /// 根据按键显示值 /// </summary> /// <param name="plane"></param> private static void KeyShowValue(GameObject plane, int value) { if (main.inputNum < 0) { main.inputNum = 15; } int index = main.inputNum--; ShowContent.ChangValue(index, value, plane); main.listMajiangAuto[index] = value; }
/// <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); }