public void OnClickOkBtn() { ISFSObject obj = new SFSObject(); ISFSArray arr = new SFSArray(); string errorMsg = string.Empty; if (_lastChoiseItem != null && _lastChoiseItem.Special > 0) { obj.PutInt("special", _lastChoiseItem.Special); } else { if (!NoDaoShui(_lastList, ref errorMsg)) { YxMessageBox.Show(new YxMessageBoxData() { Msg = errorMsg, Delayed = 3, }); YxDebug.Log("不能倒水"); return; } } int beginIndex = 0; for (int i = 0; i < 3; i++) { int count = i == 0 ? 3 : 5; List <int> tempList = _lastList.GetRange(beginIndex, count); ISFSObject arrItem = new SFSObject(); arrItem.PutInt("type", (int)CheckCardType(tempList, i)); Help1.SortList(tempList); arrItem.PutIntArray("cards", tempList.ToArray()); arr.AddSFSObject(arrItem); beginIndex += count; } obj.PutSFSArray("duninfo", arr); obj.PutInt("type", GameRequestType.FinishChoise); App.GetRServer <SssGameServer>().SendGameRequest(obj); }
public override void ShowChoiseView(ISFSObject cardData) { base.ShowChoiseView(cardData); InitPokerList(); gameObject.SetActive(true); int[] cardArray = cardData.GetIntArray("cards"); _cardValList = cardArray.ToList(); Help1.SortList(_cardValList); Help1 help = new Help1(); List <Help1.PlayerDuns> pd = help.getPlayerDuns(_cardValList); //初始化手牌,待删 for (int i = 0; i < CardsList.Count; i++) { CardsList[i].SetCardId(_cardValList[i]); CardsList[i].SetCardFront(); } RespositionCards();//初始化手牌位置 if (SpecialBtn != null) { if (pd.Count > 0 && pd[0].Special > CardType.none) { _specialDuns = pd[0]; SpecialBtn.gameObject.SetActive(true); } else { _specialDuns = null; SpecialBtn.gameObject.SetActive(false); } } SetChoiseView(_cardValList); }
public void OnClickOkBtn() { ISFSObject obj = new SFSObject(); ISFSArray arr = new SFSArray(); if (_selectInfo != null && _selectInfo.CardType > CardType.none) { obj.PutInt("special", (int)_selectInfo.CardType); } else { string errorMsg = string.Empty; if (CheckIsDaoShui(ref errorMsg)) { YxMessageBox.Show(new YxMessageBoxData() { Msg = errorMsg, Delayed = 3, }); YxDebug.Log("不能倒水"); return; } } for (int i = 0; i < 3; i++) { var lineInfo = Lines[i].LineInfo; ISFSObject arrItem = new SFSObject(); arrItem.PutInt("type", (int)lineInfo.CardType); var tempList = lineInfo.Dun.Cards; Help1.SortList(tempList, false); arrItem.PutIntArray("cards", tempList.ToArray()); arr.AddSFSObject(arrItem); } obj.PutSFSArray("duninfo", arr); //发送到服务器 obj.PutInt("type", GameRequestType.FinishChoise); App.GetRServer <SssGameServer>().SendGameRequest(obj); }
/// <summary> /// 根据牌面值对列表进行排序 /// </summary> /// <param name="list">要排序的牌列表</param> /// <param name="up">是否是升序排列</param> void Resort(List <int> list, bool up = true) { Help1.SortList(list, up); }