MockSeriesCursor
public sealed class MockSeriesCursorContinues a series pattern across successive requests, so live streams follow the pattern over time instead of restarting it with every emission.
Remarks
Section titled “Remarks”Each cycle has the shape MockSeries.GenerateValues(SeriesPattern, int, float, float, float) produces for MockSeriesCursor.CycleLength points and repeats with fresh randomness. Random walks continue from their last value. Range or noise changes apply to the next value while keeping the cycle position.
Fields
Section titled “Fields”
DefaultCycleLength
Section titled “DefaultCycleLength”public const int DefaultCycleLength = 50Default number of points per pattern cycle.
Returns
System.Int32
Constructors
Section titled “Constructors”
MockSeriesCursor(SeriesPattern, int)
Section titled “MockSeriesCursor(SeriesPattern, int)”public MockSeriesCursor(SeriesPattern pattern, int cycleLength = 50)Creates a cursor at the start of the pattern.
Parameters
| Name | Type | Description |
|---|---|---|
pattern |
MockMagic.SeriesPattern | Pattern to follow. |
cycleLength |
System.Int32 | Points per pattern cycle; values below 2 use 2. |
Methods
Section titled “Methods”
Next(int, float, float, float)
Section titled “Next(int, float, float, float)”public float[] Next(int count, float min, float max, float noise)Returns the next values of the pattern.
Parameters
| Name | Type | Description |
|---|---|---|
count |
System.Int32 | Number of values to produce. |
min |
System.Single | Lowest value. |
max |
System.Single | Highest value. |
noise |
System.Single | Random variation relative to the range, as in MockSeries.GenerateValues(SeriesPattern, int, float, float, float). |
Returns
System.Single[]: The values that follow the previously returned ones.
ContinueFrom(float)
Section titled “ContinueFrom(float)”public void ContinueFrom(float value)Continues a random walk from value instead of the middle of the range; other patterns ignore it.
Parameters
| Name | Type | Description |
|---|---|---|
value |
System.Single | Last value of data the walk should continue. |
Reset()
Section titled “Reset()”public void Reset()Returns to the start of the pattern.
Properties
Section titled “Properties”
Pattern
Section titled “Pattern”public SeriesPattern Pattern { get; }Pattern the cursor follows.
Returns
MockMagic.SeriesPattern
CycleLength
Section titled “CycleLength”public int CycleLength { get; }Points per pattern cycle.
Returns
System.Int32
Position
Section titled “Position”public long Position { get; }Number of values produced since creation or the last MockSeriesCursor.Reset().
Returns
System.Int64