Struct IntRange
Represents a range between two signed integers
Namespace: Artemis.Core
Assembly: Artemis.Core.dll
Syntax
public readonly struct IntRange
Constructors
IntRange(int, int)
Creates a new instance of the IntRange class
Declaration
public IntRange(int start, int end)
Parameters
Type | Name | Description |
---|---|---|
int | start | The start value of the range |
int | end | The end value of the range |
Properties
End
Gets the end value of the range
Declaration
public int End { get; }
Property Value
Type | Description |
---|---|
int |
Start
Gets the start value of the range
Declaration
public int Start { get; }
Property Value
Type | Description |
---|---|
int |
Methods
GetRandomValue(bool)
Declaration
public int GetRandomValue(bool inclusive = true)
Parameters
Type | Name | Description |
---|---|---|
bool | inclusive | Whether the value may be equal to Start |
Returns
Type | Description |
---|---|
int | The pseudo-random value |
IsInRange(int, bool)
Determines whether the given value is in this range
Declaration
public bool IsInRange(int value, bool inclusive = true)
Parameters
Type | Name | Description |
---|---|---|
int | value | The value to check |
bool | inclusive | Whether the value may be equal to Start or End Defaults to true |
Returns
Type | Description |
---|---|
bool |