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; } } }
public bool Equals(RangeWithStep other) { return(other.Start == Start && other.End == End && other.Step == Step); }