Appearance
Range
Inherits: Class
Methods
Contains
lua
function Range:Contains(other)
-> booleanReturns whether or not the range completely contains another range.
Parameters:
| Name | Type | Description |
|---|---|---|
other | Range | The other range |
Returns:
| Type | Description |
|---|---|
boolean |
GetEnd
lua
function Range:GetEnd()
-> numberGets the end value of the range.
Returns:
| Type | Description |
|---|---|
number |
GetLength
lua
function Range:GetLength()
-> numberGets the length of the range.
Returns:
| Type | Description |
|---|---|
number |
GetStart
lua
function Range:GetStart()
-> numberGets the start value of the range.
Returns:
| Type | Description |
|---|---|
number |
GetValues
lua
function Range:GetValues()
-> number, numberGets the start and end values of a range.
Returns:
| Name | Type | Description |
|---|---|---|
startValue | number | |
endValue | number |
Includes
lua
function Range:Includes(value)
-> booleanReturns whether or not the range includes a value.
Parameters:
| Name | Type | Description |
|---|---|---|
value | number | The value to check |
Returns:
| Type | Description |
|---|---|
boolean |
IntersectionLength
lua
function Range:IntersectionLength(other)
-> numberReturns the length of the intersection with another range or 0 if they don't intersect.
Parameters:
| Name | Type | Description |
|---|---|---|
other | Range | The other range |
Returns:
| Type | Description |
|---|---|
number |
Iterator
lua
function Range:Iterator()
-> fun():number, number, numberIterates over the integer values in the range.
Returns:
| Type | Description |
|---|---|
fun():number | Iterator with fields: value |
number | |
number |
Release
lua
function Range:Release()Releases the range object.
SetStartEnd
lua
function Range:SetStartEnd(startValue, endValue)
-> selfSets the start value and end value of the range.
Parameters:
| Name | Type | Description |
|---|---|---|
startValue | number | The start value of the range |
endValue | number | The end value of the range |
Returns:
| Type | Description |
|---|---|
self |
SetStartLength
lua
function Range:SetStartLength(startValue, length)
-> selfSets the start value and length of the range.
Parameters:
| Name | Type | Description |
|---|---|---|
startValue | number | The start value of the range |
length | number | The length of the range |
Returns:
| Type | Description |
|---|---|
self |
StartsBefore
lua
function Range:StartsBefore(other)
-> booleanReturns whether or not the range starts before another range.
Parameters:
| Name | Type | Description |
|---|---|---|
other | Range | The other range |
Returns:
| Type | Description |
|---|---|
boolean |
__tostring
lua
function Range:__tostring()Functions
AcquireStartEnd
lua
function Range.AcquireStartEnd(startValue, endValue)
-> RangeAcquires a range object for a given start and end value.
Parameters:
| Name | Type | Description |
|---|---|---|
startValue | number | The start value of the range |
endValue | number | The end value of the range |
Returns:
| Type | Description |
|---|---|
Range |
AcquireStartLength
lua
function Range.AcquireStartLength(startValue, length)
-> RangeAcquires a range object from a given start value and length.
Parameters:
| Name | Type | Description |
|---|---|---|
startValue | number | The start value of the range |
length | number | The length of the range |
Returns:
| Type | Description |
|---|---|
Range |
StaticStartEnd
lua
function Range.StaticStartEnd(startValue, endValue)
-> RangeAcquires a static range object (can't be released or mutated) for a given start and end value.
Parameters:
| Name | Type | Description |
|---|---|---|
startValue | number | The start value of the range |
endValue | number | The end value of the range |
Returns:
| Type | Description |
|---|---|
Range |