Table of Contents

Struct FloatRange

Namespace
Artemis.Core
Assembly
Artemis.Core.dll

Represents a range between two single-precision floating point numbers

public readonly struct FloatRange
Inherited Members

Constructors

FloatRange(float, float)

Creates a new instance of the FloatRange class

[JsonConstructor]
public FloatRange(float start, float end)

Parameters

start float

The start value of the range

end float

The end value of the range

Properties

End

Gets the end value of the range

public float End { get; }

Property Value

float

Start

Gets the start value of the range

public float Start { get; }

Property Value

float

Methods

GetRandomValue(bool)

Returns a pseudo-random value between Start and End

public float GetRandomValue(bool inclusive = true)

Parameters

inclusive bool

Whether the value may be equal to Start

Returns

float

The pseudo-random value

IsInRange(float, bool)

Determines whether the given value is in this range

public bool IsInRange(float value, bool inclusive = true)

Parameters

value float

The value to check

inclusive bool

Whether the value may be equal to Start or End

Defaults to true

Returns

bool