コード例 #1
0
        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);
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public bool Do(HandCardManager handcards, CardModel card)
 {
     throw new NotImplementedException();
 }
コード例 #5
0
ファイル: OptionHu.cs プロジェクト: yiluxiaozhan/appleGameSVN
 public bool Do(HandCardManager handCards, Card card)
 {
     return(false);
 }
コード例 #6
0
 /// <summary>
 /// 执行操作
 /// </summary>
 /// <param name="handCards"></param>
 public bool Do(HandCardManager handCards)
 {
     return(Option.Do(handCards, Card));
 }