public static int GetRandInteger() { if (!_queueIsFiled) { try { _integers = GetRandIntegers(_range); _queueIsFiled = true; _error = false; _queueIsFiled = true; int result = _integers.Dequeue(); return(result); } catch (Exception e) { _error = true; int ret = RandomSeed.Guid() % _range; if (ret < 0) { return(ret * -1); } } } else { if (_integers.Any() && !_error) { return(_integers.Dequeue()); } } int rect = RandomSeed.Guid() % _range; if (rect < 0) { return(rect * -1); } else { return(rect); } }