Example #1
0
        /// <summary>
        /// 计算听牌情况
        /// </summary>
        /// <param name="ting"> 听了哪些牌 </param>
        public void CalcTing(Ting ting)
        {
            ting.Clear();

            for (int c = 0; c < 3; c++)
            {
                for (int i = 1; i <= 9; i++)
                {
                    if (hand.colors[c].Insert(i))
                    {
                        if (CheckHu())
                        {
                            ting.points[c].Add(i);
                        }

                        hand.colors[c].Delete(i);
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// 计算舍牌之后的听牌情况
        /// </summary>
        /// <param name="forgive"> 舍了(花色,数字)之后,听了哪些牌</param>
        public void CalcForgive(Dictionary <KeyValuePair <int, int>, Ting> forgive)
        {
            forgive.Clear();
            for (int c = 0; c < 3; c++)
            {
                for (int i = 1; i <= 9; i++)
                {
                    if (hand.colors[c].Delete(i))
                    {
                        Ting ting = new Ting();
                        CalcTing(ting);
                        if (ting.Size() > 0)
                        {
                            forgive[new KeyValuePair <int, int>(c, i)] = ting;
                        }

                        hand.colors[c].Insert(i);
                    }
                }
            }
        }