示例#1
0
 public bool IsSingleCardWin(ClsCard c, ClsCard d)//Kiểm tra xem quân bài thứ 2 có thắng quân bài thứ nhất không.
 {
     if (d.Value > c.Value || (d.Value == c.Value && d.Character > c.Character))
     {
         return(true);
     }
     return(false);
 }
示例#2
0
 public bool IsContain(List <ClsCard> arr, ClsCard t)
 {
     foreach (ClsCard c in arr)
     {
         if (t.Value == c.Value && t.Character == c.Character)
         {
             return(true);
         }
     }
     return(false);
 }
示例#3
0
 public void getBai(List <ClsCard> arr, int num)
 {
     for (int i = 0; i < num; i++)
     {
         ClsCard t = new ClsCard();
         do
         {
             Random r = new Random();
             t.Value     = r.Next(3, 16);
             t.Character = r.Next(1, 5);
         } while (IsContain(arr, t));
         arr.Add(t);
     }
 }
示例#4
0
        public bool sanhRong(List <ClsCard> bai)
        {
            bai.Sort();
            int soValue = 0;

            for (int i = 3; i <= 14; i++)
            {
                for (int j = 1; j <= 4; j++)
                {
                    ClsCard t = new ClsCard(i, j);
                    if (g.IsContain(bai, t))
                    {
                        soValue += 1;
                        break;
                    }
                }
            }
            if (soValue == 12)
            {
                return(true);
            }
            return(false);
        }