Exemple #1
0
        public int PickNumber()
        {
            var cats = GameType.GetLegalCategories();

            if (NumbersShowing.Count == cats.Count * 15)
            {
                return(0);
            }

            int num;

            while (true)
            {
                Rng.GetBytes(_rngBuffer);
                var rngNum = BitConverter.ToInt32(_rngBuffer, 0);
                num = (rngNum % 75) + 1;

                if (Numbers.Contains(num))
                {
                    continue;
                }
                Numbers.Add(num);

                if (!cats.Contains(GetRowForNumber(num)))
                {
                    continue;
                }

                NumbersShowing.Add(num);
                break;
            }

            CurrentNumber = num;

            return(num);
        }
Exemple #2
0
 public void ResetBoard()
 {
     Numbers.Clear();
     NumbersShowing.Clear();
     CurrentNumber = -1;
 }