Exemplo n.º 1
0
 public static bool isSingleCardWin(ClsCard Card1, ClsCard Card2)
 {
     if (Card1 < Card2)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 public static void sort(List <ClsCard> Card)
 {
     for (int i = 0; i < Card.Count - 1; i++)
     {
         for (int j = i + 1; j < Card.Count; j++)
         {
             if (Card[j] < Card[i])
             {
                 ClsCard t = new ClsCard(0, 0);
                 t.setCard(Card[i]);
                 Card[i].setCard(Card[j]);
                 Card[j].setCard(t);
             }
         }
     }
 }
Exemplo n.º 3
0
        public void deal()
        {
            List <int> T = new List <int>();

            for (int i = 0; i < 52; i++)
            {
                T.Add(i);
            }
            Random rand = new Random();

            for (int i = 0; i < 13 * numOfPlayers; i++)
            {
                int     j    = rand.Next(T.Count);
                ClsCard Card = new ClsCard(T[j] / 4, T[j] % 4);
                arrPlayers[i % numOfPlayers].getarrCards().Add(Card);
                T.RemoveAt(j);
            }
            for (int i = 0; i < numOfPlayers; i++)
            {
                //ClsRules.sort(arrPlayers[i].getarrCards());
                arrPlayers[i].setnumOfCard(13);
            }
        }
Exemplo n.º 4
0
 public void setCard(ClsCard Card)
 {
     value     = Card.value;
     character = Card.character;
 }