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