예제 #1
0
 public void PlayerSendCard(Player player, ICollection <CardGroup> cardGroups)
 {
     if (Ruler.IsValidateForPlayer(player.Cards.ToCardGroups(), cardGroups) && Ruler.IsValidate(this, cardGroups))
     {
         var cards = cardGroups.ToCards();
         player.RemoveCard(cards);
         LastSendIndex = Cycle.List.FindIndex(p => p == player);
         var stringBuilder = new StringBuilder();
         cards.ForEach(card => stringBuilder.Append(card));
         GroupSender.Send($"{player.ToAtCode()} 出牌: {stringBuilder}");
         Cycle.MoveNext();
         Tick();
     }
     else
     {
         GroupSender.Send("你出的牌无效");
     }
 }