Table of Contents

Struct EvolvingNatFloat

Namespace
Vintagestory.API.MathTools
Assembly
VintagestoryAPI.dll

A number generator whose return value changes over time, parametrized by a transform function and some constants

[DocumentAsJson]
[JsonObject(MemberSerialization.OptIn)]
public struct EvolvingNatFloat
Inherited Members
Extension Methods

Constructors

EvolvingNatFloat()

public EvolvingNatFloat()

EvolvingNatFloat(EnumTransformFunction, float)

public EvolvingNatFloat(EnumTransformFunction transform, float factor)

Parameters

transform EnumTransformFunction
factor float

Fields

NoValueSet

public static readonly EvolvingNatFloat NoValueSet

Field Value

EvolvingNatFloat

Properties

Factor

public float Factor { get; }

Property Value

float

MaxValue

public float? MaxValue { get; }

Property Value

float?

Transform

public EnumTransformFunction Transform { get; }

Property Value

EnumTransformFunction

Methods

Clone()

public EvolvingNatFloat Clone()

Returns

EvolvingNatFloat

CreateFromBytes(BinaryReader)

public static EvolvingNatFloat CreateFromBytes(BinaryReader reader)

Parameters

reader BinaryReader

Returns

EvolvingNatFloat

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToBytes(BinaryWriter)

public void ToBytes(BinaryWriter writer)

Parameters

writer BinaryWriter

create(EnumTransformFunction, float)

public static EvolvingNatFloat create(EnumTransformFunction function, float factor)

Parameters

function EnumTransformFunction
factor float

Returns

EvolvingNatFloat

createIdentical(float)

public static EvolvingNatFloat createIdentical(float factor)

Parameters

factor float

Returns

EvolvingNatFloat

nextFloat(float, float)

The sequence should always run from 0 to n

public float nextFloat(float firstvalue, float sequence)

Parameters

firstvalue float
sequence float

Returns

float

Operators

operator ==(EvolvingNatFloat, EvolvingNatFloat)

public static bool operator ==(EvolvingNatFloat left, EvolvingNatFloat right)

Parameters

left EvolvingNatFloat
right EvolvingNatFloat

Returns

bool

operator !=(EvolvingNatFloat, EvolvingNatFloat)

public static bool operator !=(EvolvingNatFloat left, EvolvingNatFloat right)

Parameters

left EvolvingNatFloat
right EvolvingNatFloat

Returns

bool