Abacus  v0.1.0-alpha
Playtesting tools for Unity
Abacus.Internal.Metric< T > Class Template Referenceabstract

Abstract base class for all Metric types; Create a new Metric class by inheriting from this More...

Inheritance diagram for Abacus.Internal.Metric< T >:
Abacus.Internal.IRecordable Abacus.FieldMetric< T > Abacus.PropertyMetric< T >

Public Member Functions

void AttachVariable (Component component, string variableName)
 Attach a variable to the metric to be recorded More...
 
object Dump ()
 Returns the metric's data as an object to be serialized More...
 
string GetVariableName ()
 The name of the variable that this Metric records More...
 
Type GetValueType ()
 The type that this Metric records More...
 
abstract T GetValue ()
 
GetLastRecordedValue ()
 The last value recorded by this metric More...
 
void Record ()
 Records the current value of the attached variable More...
 
void SetSource (Component component)
 Sets the component that the metric retrieves a field or property from More...
 
void SetTimeStep (float timeStep)
 Sets the time step for the recorder More...
 
void Enable ()
 Enables the metric recorder More...
 
void Disable ()
 Disables the metric recorder More...
 

Public Attributes

float TimeStep => _timeStep
 The time step duration of the metric recorder More...
 
bool IsEnabled => _isEnabled
 Whether the metric recorder is enabled More...
 

Protected Attributes

bool _recordOnStart = true
 
float _timeStep = 1f
 
bool _isEnabled = false
 
GameObject recordGameObject
 
Component recordFrom
 
int recordFromIndex
 
string recordName
 
int recordNameIndex
 
Type componentType
 
float startTime
 
_lastRecordedValue
 
_previousValue
 

Properties

abstract bool RetrievedMember [get]
 Whether the metric recorder has retrieved the field/property it will record the value of More...
 
List< DataPoint< T > > History = new List<DataPoint<T>>() [get]
 The history of recorded values for this metric More...
 
- Properties inherited from Abacus.Internal.IRecordable
float TimeStep [get]
 
bool IsEnabled [get]
 

Detailed Description

Abstract base class for all Metric types; Create a new Metric class by inheriting from this

Template Parameters
TThe data type for the metric to hold

Member Function Documentation

◆ AttachVariable()

void Abacus.Internal.Metric< T >.AttachVariable ( Component  component,
string  variableName 
)

Attach a variable to the metric to be recorded

Parameters
componentThe component the variable is a member of
variableNameThe variable name as a string

◆ Disable()

void Abacus.Internal.Metric< T >.Disable ( )

Disables the metric recorder

Implements Abacus.Internal.IRecordable.

◆ Dump()

object Abacus.Internal.Metric< T >.Dump ( )

Returns the metric's data as an object to be serialized

Returns
The metric's data as an object

Implements Abacus.Internal.IRecordable.

◆ Enable()

void Abacus.Internal.Metric< T >.Enable ( )

Enables the metric recorder

Implements Abacus.Internal.IRecordable.

◆ GetLastRecordedValue()

T Abacus.Internal.Metric< T >.GetLastRecordedValue ( )

The last value recorded by this metric

Returns
The last value recorded by this metric

◆ GetValueType()

Type Abacus.Internal.Metric< T >.GetValueType ( )

The type that this Metric records

Returns
The type that this Metric records for

Implements Abacus.Internal.IRecordable.

◆ GetVariableName()

string Abacus.Internal.Metric< T >.GetVariableName ( )

The name of the variable that this Metric records

Returns
The type that this Metric records for

Implements Abacus.Internal.IRecordable.

◆ Record()

void Abacus.Internal.Metric< T >.Record ( )

Records the current value of the attached variable

Implements Abacus.Internal.IRecordable.

◆ SetSource()

void Abacus.Internal.Metric< T >.SetSource ( Component  component)

Sets the component that the metric retrieves a field or property from

Parameters
component

Implements Abacus.Internal.IRecordable.

◆ SetTimeStep()

void Abacus.Internal.Metric< T >.SetTimeStep ( float  timeStep)

Sets the time step for the recorder

Parameters
timeStepThe new time step duration (s)

Member Data Documentation

◆ IsEnabled

bool Abacus.Internal.Metric< T >.IsEnabled => _isEnabled

Whether the metric recorder is enabled

◆ TimeStep

float Abacus.Internal.Metric< T >.TimeStep => _timeStep

The time step duration of the metric recorder

Property Documentation

◆ History

List<DataPoint<T> > Abacus.Internal.Metric< T >.History = new List<DataPoint<T>>()
get

The history of recorded values for this metric

◆ RetrievedMember

abstract bool Abacus.Internal.Metric< T >.RetrievedMember
get

Whether the metric recorder has retrieved the field/property it will record the value of


The documentation for this class was generated from the following file: