Beispiel #1
0
        public RummyTile DrawTile()
        {
            try
            {
                Random randDraw = new Random();

                int       num    = randDraw.Next(poolGen.Count);
                RummyTile myTile = poolGen[num];
                poolGen.RemoveAt(num);
                return(myTile);
            }
            catch
            {
                throw new Exception("pool empty");
            }
        }
Beispiel #2
0
 public void Randomize()
 {
     try
     {
         int    n   = poolGen.Count;
         Random rnd = new Random();
         while (n > 1)
         {
             int k = (rnd.Next(0, n) % n);
             n--;
             RummyTile value = poolGen[k];
             poolGen[k] = poolGen[n];
             poolGen[n] = value;
         }
     }
     catch (Exception)
     {
         throw new Exception("The pool is empyt");
     }
 }
Beispiel #3
0
 public RummyTile(RummyTile RT)
 {
     _n   = RT._n;
     _clr = RT._clr;
 }