예제 #1
0
            public StructRangeWithStepEnumerator(RangeWithStep range)
            {
                this.range = range;
                Current    = range.Start - range.Step;

                if (range.Inclusive)
                {
                    if (range.Step > 0)
                    {
                        compare = (a, b) => a <= b;
                    }
                    else
                    {
                        compare = (a, b) => a >= b;
                    }
                }
                else
                {
                    if (range.Step > 0)
                    {
                        compare = (a, b) => a < b;
                    }
                    else
                    {
                        compare = (a, b) => a > b;
                    }
                }
            }
예제 #2
0
 public bool Equals(RangeWithStep other)
 {
     return(other.Start == Start && other.End == End && other.Step == Step);
 }