Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Channel

It represents a channel of Automaton.

Hierarchy

  • Channel

Index

Constructors

constructor

Properties

Protected __automaton

__automaton: Automaton

The parent automaton.

Protected __head

__head: number = 0

The index of __items it should evaluate next.

Protected __items

__items: ChannelItem[] = []

List of channel items.

Protected __listeners

__listeners: Array<(event: ChannelUpdateEvent) => void> = []

An array of listeners.

Protected __time

__time: number = -Infinity

The time that was used for the calculation of [[__lastValue]].

Protected __value

__value: number = 0

A cache of last calculated value.

Accessors

currentTime

  • get currentTime(): number
  • The time that was used for the calculation of [[__lastValue]].

    Returns number

currentValue

  • get currentValue(): number
  • A cache of last calculated value.

    Returns number

Methods

consume

  • consume(time: number): [time: number, update: () => void][]
  • This method is intended to be used by Automaton.update. Consume and return items.

    Parameters

    • time: number

      The current time of the parent Automaton

    Returns [time: number, update: () => void][]

    Array of tuples, [ timing of the event, a function that execute the event ]

deserialize

getValue

  • getValue(time: number): number
  • Return the value of specified time point.

    Parameters

    • time: number

      Time at the point you want to grab the value.

    Returns number

    Result value

reset

  • reset(): void
  • Reset the internal states. Call this method when you seek the time.

    Returns void

subscribe

Generated using TypeDoc