Skip to main content

Class BaseMeanValueVariable<T0, T1>

Abstract base class for a float variable representing the mean (average) value of multiple variables.

public abstract class BaseMeanValueVariable<T0, T1> : FloatVariable, IAddable<float>, ISubtractable<float> where T0 : BaseScriptableVariable<T1> where T1 : struct, IComparable<T1>, IEquatable<T1>, IConvertible

Type Parameters​

NameTypeDescription
T0The type of the variables to average, which must inherit from BaseScriptableVariable.
T1The value type of the variables, constrained to value types implementing IComparable, IEquatable, and IConvertible.

Inheritance​

Implements​

Inherited Members​

Fields​

variables​

The array of variables whose values are averaged.

public T0[] variables

Field Value​

T0[]

Properties​

AverageValue​

Gets the computed average value based on the current runtime values of variables.

protected abstract float AverageValue { get; }

Property Value​

float

RuntimeValue​

Gets the runtime value of the variable, which is the computed average of all referenced variables.

public override float RuntimeValue { get; }

Property Value​

float

Methods​

IsValid()​

Determines whether this variable is valid (i.e., has one or more variables to average).

public override bool IsValid()

Returns​

bool — true if variables contains one or more elements; otherwise, false.