public bool Do(HandCardManager handCards, CardModel card) { MaJiangCollection cards = handCards.SleepCards.FindThree(card); ///杠自己碰的牌 if (!(cards is null)) { if (handCards.IstheSameWhithPikedCard(card)) { cards.Add(handCards.CardPicked); handCards.SetCardPicked(null); return(true); } } cards = handCards.StandCards.GetSameCards(card, 4); //暗杠 if (!(cards is null)) { handCards.StandCards.RemoveAll(c => c.IsTheSameWith(card)); handCards.SleepCards.Add(cards); return(true); } cards = handCards.StandCards.GetSameCards(card, 3); if (!(cards is null) && handCards.CardPicked.IsTheSameWith(card)) { cards.Add(handCards.CardPicked); handCards.SetCardPicked(null); handCards.StandCards.RemoveAll(c => c.IsTheSameWith(card)); handCards.SleepCards.Add(cards); return(true); } return(false); }
/// <summary> /// 存放要牌操作 /// </summary> /// <param name="handCards"></param> /// <returns></returns> public OptionorCollection FreshOptions(HandCardManager handCards) { handCards.Optionors.Clear(); MaJiangCollection huCards = GetHuCards(handCards.StandCards); if (huCards.Count > 0) { for (int i = 0; i < huCards.Count; i++) { Optionor optionor = new Optionor(new OptionHu(), huCards[i]); handCards.AddOptionor(optionor); } } MaJiangCollection PendCards = handCards.GetPengCards(); if (PendCards.Count > 0) { for (int i = 0; i < PendCards.Count; i++) { Optionor optionor = new Optionor(new OptionPeng(), PendCards[0]); handCards.AddOptionor(optionor); } } MaJiangCollection GangCards = handCards.GetGangCards(); if (GangCards.Count > 0) { for (int i = 0; i < GangCards.Count; i++) { Optionor optionor = new Optionor(new OptionGang(), GangCards[i]); handCards.AddOptionor(optionor); } } return(handCards.Optionors); }
public bool Do(HandCardManager handCards, Card card) { MaJiangCollection majians = handCards.StandCards.GetSameCards(card, 2); if (!(majians is null)) { handCards.StandCards.RemoveCountOf(card, 2); majians.Add(card); handCards.SleepCards.Add(majians); } return(false); }
public bool Do(HandCardManager handcards, CardModel card) { throw new NotImplementedException(); }
public bool Do(HandCardManager handCards, Card card) { return(false); }
/// <summary> /// 执行操作 /// </summary> /// <param name="handCards"></param> public bool Do(HandCardManager handCards) { return(Option.Do(handCards, Card)); }