コード例 #1
0
 //机器人(托管)出卡
 public List <Card> IntelligentOutCard(ref PeopleList[] people, int landlord, int whoOut, int nowPerson, List <Card> prevCard)
 {
     List <Card> [] TCard = new List <Card> [4];
     for (int j = 0; j < 4; j++)
     {
         TCard[j] = Card.CopyListCard(people[j].deck);
         TCard[j].Sort(Card.CampareModeCardNum); //在计算相应算法之前,必须先按照牌的数量进行排序
     }
     return(gamemode.Robort_IntelligentOutCard(ref TCard, landlord, whoOut, nowPerson, prevCard));
 }
コード例 #2
0
        //判断出完这次牌后,下一次能不能一次出完
        private Boolean AfterThisOut_CanOutAllCard(List <Card> people, List <Card> thisCard)
        {
            List <Card> tDeck = Card.CopyListCard(people);

            for (int i = 0; i < thisCard.Count; i++)
            {
                tDeck.Remove(thisCard[i]);
            }
            List <Card> tCard = Robort_Free_Remind(tDeck, 1);

            if (tCard.Count == tDeck.Count)    //如果该玩家提示的牌可全部出完
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #3
0
        //玩家提示出卡
        public List <Card> Remind(ref PeopleList people, List <Card> prevCard)
        {
            List <Card> TCard = new List <Card>();

            for (int j = 0; j < 4; j++)
            {
                TCard = Card.CopyListCard(people.deck);
            }
            if (people.Remind_flag == false)
            {
                if (prevCard != null)
                {
                    people.Result = gamemode.ComupterRemind(TCard, prevCard);
                }
                else
                {
                    people.Result = gamemode.PlayerRemind(TCard, prevCard, ref people.remindStyle);
                }
                if (people.Result.Count != 0)
                {
                    people.Remind_flag = true;
                }
            }
            else
            {
                if (people.remindStyle == 1)    //如果当前有人出牌
                {
                    people.Result = gamemode.ComupterRemind(TCard, people.Result);
                }
                else
                {
                    people.Result = gamemode.PlayerRemind(TCard, people.Result, ref people.remindStyle); //按类型提示出牌
                    if (people.Result.Count == 0)                                                        //如果当前没牌提示,则提示下一种类型的牌
                    {
                        people.Remind_flag = false;
                        Remind(ref people, prevCard);
                    }
                }
            }
            return(people.Result);
        }