IRangeOps

Description

[StaticTemplate]
interface Tinman.Core.Math.IRangeOps
<TValue>
<TRange>
<TLength out>

Extended by

IRangeOpsF
RangeE struct

Defines common operations for range values.

Public / Methods

Clamp


[Pure]
public method Clamp → (1)

value in : TValue

The value to clamp.

returns → TValue

The clamped value.

Clamps the given value to this range.

Contains

2 overloads


[Pure]
public method Contains1 → (1)

value in : TValue

The value.

returns → bool

true if value in is contained in this range, false if not.

Checks if this range contains the given value.


[Pure]
public method Contains2 → (1)

range in : TRange

The range.

returns → bool

true if range in is fully contained in this range, false if not.

Checks if this range fully contains the given range.

Grow

2 overloads


[Pure]
public method Grow1 → (1)

value in : TValue

The value.

returns → TRange

The resulting range.

Grows this range so that it contains the given value.


[Pure]
public method Grow2 → (1)

range in : TRange

The range.

returns → TRange

The resulting range.

Grows this range so that it fully contains the given range.

Intersection


[Pure]
public method Intersection → (1)

other in : TRange

The other range.

returns → TRange

The resulting range.

Intersects this range with the given one.

Intersects


[Pure]
public method Intersects → (1)

other in : TRange

The other range.

returns → bool

true if both ranges intersect, false if not.

Checks if this range intersects with the given one.

To​String


[Pure]
public method ToString → (1)

formatFlags in : FormatFlags

The format flags to use, see Format.ThisNum.

returns → string

The string representation.

Returns the string representation of this range.

Public / Attributes

Is​Empty


public attribute IsEmpty → (get)

value : bool

true if this range is empty. false if not.

Is this range empty (i.e. its length is zero)?

Length


public attribute Length → (get)

value : TLength

[>=0]
The range length.

Returns the length of the range.