public void OnActionResult(MsgActionResultNotify msg) { // 出牌 if (msg.Action == (int)ActionType.EnumActionTypeDiscard) { var discardedHands = msg.ActionHands; foreach (var h in discardedHands) { foreach (var d in h.Cards) { TilesHandList.Remove(d); } MeldList.Add(h); } Hand2Buttons(); MeldList2Buttons(); //MyOwner.BtnDiscard.Content = new Image() { Source = ImagesSrc[msg.actionTile] }; //MyOwner.TbDiscard.Text = $"{MyPlayer.Name}->{MyOwner.TileId2Name(msg.actionTile)}"; //MyOwner.AppendActionLog($"[discard]({MyPlayer.Name}):{MyOwner.TileId2Name(msg.actionTile)}"); return; } }
public void Reset2New() { HideAllButtons(); TilesFlowerList.Clear(); TilesHandList.Clear(); MeldList.Clear(); BankerChairId = 0; TbRichi.Text = ""; TbPseudoFlower.Text = ""; }
private void SortHandTiles() { TilesHandList.Sort((x, y) => x - y); }
public void OnDeal(MsgDeal msg) { Reset2New(); MsgPlayerCardList myPlayList = null; foreach (var ptl in msg.playerCardLists) { if (ptl.chairID == MyPlayer.ChairId) { myPlayList = ptl; break; } } if (myPlayList == null) { return; } if (myPlayList.cardsOnHand.Count < 1) { return; } //// 庄家标记 //TbName.Text = msg.bankerChairID == MyPlayer.ChairId ? $"{MyPlayer.Name}(庄)" : $"{MyPlayer.Name}"; //BankerChairId = msg.bankerChairID; //TbScore.Text = ""; //if (!MyOwner.IsPlaying) //{ // MyOwner.IsPlaying = true; // MyOwner.ClearLog(); // MyOwner.AppendLog("[begin]\r\n"); // MyOwner.ResetActionListWndIndex(); //} //if (IsBandker) //{ // TbPseudoFlower.Text = MyOwner.TileId2Name(msg.windFlowerID); // MyOwner.AppendLog($"[bank]:{MyPlayer.Name}\r\n"); // MyOwner.AppendLog($"[wind]:{MyOwner.TileId2Name(msg.windFlowerID)}\r\n"); // MyOwner.TbTileInWallRemain.Text = msg.tilesInWall.ToString(); // MyOwner.ResetScoreWnd(); //} // 手牌列表 TilesHandList.AddRange(myPlayList.cardsOnHand); Hand2Buttons(); //// 花牌列表 //TilesFlowerList.AddRange(myPlayList.tilesFlower); //Flower2Buttons(); //var sb = new StringBuilder(); //sb.Append($"[deal]({MyPlayer.Name})(hand):"); //foreach (var i in TilesHandList) //{ // sb.Append(MyOwner.TileId2Name(i)); // sb.Append(","); //} //sb.AppendLine(); //sb.Append("\t(flower):"); //foreach (var i in TilesFlowerList) //{ // sb.Append(MyOwner.TileId2Name(i)); // sb.Append(","); //} //sb.AppendLine(); //MyOwner.AppendLog(sb.ToString()); }