Exemple #1
0
        /// <param name="minimum">Minimum value</param>
        /// <param name="maximum">Maximum value</param>
        /// <param name="inclusivity">Range inclusivity</param>
        public Range(
            T minimum,
            T maximum,
            RangeInclusivity inclusivity = RangeInclusivity.InclusiveMinInclusiveMax)
        {
            Inclusivity = inclusivity;
            var reverse = minimum.CompareTo(maximum) > 0;

            _minimum = new Settable <T>(reverse ? maximum : minimum);
            _maximum = new Settable <T>(reverse ? minimum : maximum);
        }
Exemple #2
0
 public Range(IRange <T> range)
 {
     Inclusivity = range.Inclusivity;
     _minimum    = new Settable <T>(range.Minimum);
     _maximum    = new Settable <T>(range.Maximum);
 }