Options
All
  • Public
  • Public/Protected
  • All
Menu

Manager class for Timers

export
class

TimerManager

Hierarchy

  • TimerManager

Index

Constructors

constructor

Properties

Private _last

_last: number

Private _timersToDelete

_timersToDelete: Timer[]

timers

timers: Timer[]

Methods

Private _getDeltaMS

  • _getDeltaMS(): number

Private _remove

  • _remove(timer: Timer): void

addTimer

  • addTimer(timer: Timer): void
  • Add timer to this timerManager, and remove timer from it's original timerManager.

    memberof

    TimerManager

    Parameters

    • timer: Timer

      The timer to be added.

    Returns void

createTimer

  • createTimer(time: number): Timer
  • Create a new timer under this timerManager.

    memberof

    TimerManager

    Parameters

    • time: number

      time of newly created timer.

    Returns Timer

    The newly created timer.

removeTimer

  • removeTimer(timer: Timer): void
  • Remove timer from this timerManager.

    memberof

    TimerManager

    Parameters

    • timer: Timer

      The timer to be removed.

    Returns void

update

  • update(delta?: undefined | number): void
  • Increment all managed timers' time.

    Better to use this method instead of timers.update() for centralized control.

    memberof

    TimerManager

    Parameters

    • Optional delta: undefined | number

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc