InterpolatedTimeMachine<T>

class InterpolatedTimeMachine<T> : TimeMachine<T>, Protogame.ITimeMachine<T>, Protogame.ITimeMachine

A form of time machine that supports interpolation and extrapolation of values between keys.

Type Parameters:
 
  • T – The type of data that will be tracked by the time machine.
public Protogame.T Get(int tick)

Retrieves the value at the specified tick, or interpolates / extrapolates a value from the known values in the time machine.

Parameters:
  • tick (int) – The tick at which to retrieve the value.
Returns:

The .

protected abstract Protogame.T AddType(Protogame.T a, Protogame.T b)
Parameters:
  • a (Protogame.T) –
  • b (Protogame.T) –
protected abstract Protogame.T DefaultType()

Return the default value of when neither interpolation or extrapolation can be performed.

Returns:The default value.
protected abstract Protogame.T DivideType(Protogame.T b, int a)
Parameters:
  • b (Protogame.T) –
  • a (int) –
protected abstract Protogame.T MultiplyType(Protogame.T a, int b)
Parameters:
  • a (Protogame.T) –
  • b (int) –
protected abstract Protogame.T SubtractType(Protogame.T a, Protogame.T b)
Parameters:
  • a (Protogame.T) –
  • b (Protogame.T) –
protected abstract bool ValueIsZeroType(Protogame.T value)
Parameters:
  • value (Protogame.T) –