Show / Hide Table of Contents

Class IntRange

Range bounded by int numbers. Alternative to System.Range without at end indexes support. With System.Range you have to know length of sequence for ^1 like indices and so can't calculate Length of range.

Inheritance
System.Object
IntRange
Namespace: Eco.Shared.Math
Assembly: Eco.Shared.dll
Syntax
public sealed class IntRange : ValueType

Constructors

IntRange(Int32, Int32)

Declaration
public IntRange(int start, int end)
Parameters
Type Name Description
System.Int32 start
System.Int32 end

Fields

End

Declaration
public readonly int End
Field Value
Type Description
System.Int32

Start

Declaration
public readonly int Start
Field Value
Type Description
System.Int32

Properties

Length

Length of the range.

Declaration
public int Length { get; }
Property Value
Type Description
System.Int32

Methods

After(IntRange, Int32)

Makes new IntRange right after the range with specified length.

Declaration
public static IntRange After(IntRange range, int length)
Parameters
Type Name Description
IntRange range
System.Int32 length
Returns
Type Description
IntRange

FromOffsetAndLength(Int32, Int32)

Makes IntRange from offset and length instead of two indexes.

Declaration
public static IntRange FromOffsetAndLength(int offset, int length)
Parameters
Type Name Description
System.Int32 offset
System.Int32 length
Returns
Type Description
IntRange

Operators

Implicit(IntRange to Range)

Implicitly converts to System.Range for array accessors etc.

Declaration
public static implicit operator Range(IntRange range)
Parameters
Type Name Description
IntRange range
Returns
Type Description
System.Range

Extension Methods

CommandLine.FeedFromCommandLine(Object)
CommandLine.ToCommandLineArgs(Object, Func<Object, Boolean>)
ListUtil.DepthFirstTraversal<T>(T, Func<T, IEnumerable<T>>)
EnumerableExtensions.SingleItemAsEnumerable<T>(T)
EventUtils.RaiseEvent<TEventArgs>(Object, String, TEventArgs)
PredicateUtils.MatchesAll<TEnumerable, T>(T, TEnumerable)
PredicateUtils.MatchesAll<T>(T, Func<T, Boolean>[])
PredicateUtils.MatchesAny<TEnumerable, T>(T, TEnumerable)
ReflectionUtils.PropertyValue<T>(Object, PropertyInfo)
ReflectionUtils.TryGetPropertyValueByName<T>(Object, String, out T)
ReflectionUtils.GetPropertyValueByName<T>(Object, String)
ReflectionUtils.SetPropertyByName(Object, String, Object)
ReflectionUtils.GetStructPropertyByName<T>(Object, String)
ReflectionUtils.GetStringPropertyByName(Object, String)
ReflectionUtils.ZipByProperty<T>(Object, Object, Object, Func<T, T, T>)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾