Table of Contents

Class FloatSequenceGenerator

Namespace
LfrlAnvil.Generators
Assembly
LfrlAnvil.Core.dll

Represents float sequence generator of values within specified range.

public class FloatSequenceGenerator : SequenceGeneratorBase<float>, ISequenceGenerator<float>, IBoundGenerator<float>, IGenerator<float>, IGenerator
Inheritance
FloatSequenceGenerator
Implements
Inherited Members
Extension Methods

Constructors

FloatSequenceGenerator()

Creates a new FloatSequenceGenerator instance that starts with 0, with Step equal to 1 and with greatest possible Bounds.

public FloatSequenceGenerator()

FloatSequenceGenerator(Bounds<float>)

Creates a new FloatSequenceGenerator instance that starts with minimum possible value defined by bounds, with Step equal to 1.

public FloatSequenceGenerator(Bounds<float> bounds)

Parameters

bounds Bounds<float>

Range of values that can be generated.

FloatSequenceGenerator(Bounds<float>, float, float)

Creates a new FloatSequenceGenerator instance.

public FloatSequenceGenerator(Bounds<float> bounds, float start, float step = 1)

Parameters

bounds Bounds<float>

Range of values that can be generated.

start float

Next value to generate.

step float

Difference between two consecutively generated values. Equal to 1 by default.

Exceptions

ArgumentOutOfRangeException

When bounds do not contain start.

ArgumentException

When step is equal to 0 or any of the values is not a finite number.

FloatSequenceGenerator(float, float)

Creates a new FloatSequenceGenerator instance with greatest possible Bounds.

public FloatSequenceGenerator(float start, float step = 1)

Parameters

start float

Next value to generate.

step float

Difference between two consecutively generated values. Equal to 1 by default.

Exceptions

ArgumentException

When step is equal to 0 or any of the values is not a finite number.

Methods

AddStep(float)

Adds Step to the previously generated value in order to calculate the next value to generate.

protected override sealed float AddStep(float value)

Parameters

value float

Previously generated value.

Returns

float

Next value to generate.

Exceptions

OverflowException

When an arithmetic overflow occurred.