Abacus  v0.1.0-alpha
Playtesting tools for Unity
Abacus.PropertyMetric< T > Class Template Reference

Abstract base class for all property-based metrics; Create a new PropertyMetric recorder class by inheriting from this More...

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

Public Member Functions

override T GetValue ()
 Retrieve the current value from the property More...
 
- Public Member Functions inherited from Abacus.Internal.Metric< T >
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...
 
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

override bool RetrievedMember => _read != null
 
- Public Attributes inherited from Abacus.Internal.Metric< T >
float TimeStep => _timeStep
 The time step duration of the metric recorder More...
 
bool IsEnabled => _isEnabled
 Whether the metric recorder is enabled More...
 

Protected Member Functions

virtual bool AreEqual (T a, T b)
 

Additional Inherited Members

- Protected Attributes inherited from Abacus.Internal.Metric< T >
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 inherited from Abacus.Internal.Metric< T >
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 property-based metrics; Create a new PropertyMetric recorder class by inheriting from this

Template Parameters
TThe data type for the property metric to hold

Member Function Documentation

◆ GetValue()

override T Abacus.PropertyMetric< T >.GetValue ( )
virtual

Retrieve the current value from the property

Uses reflection! Call only as necessary!

Returns
The current value from the property

Implements Abacus.Internal.Metric< T >.


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