Options
All
  • Public
  • Public/Protected
  • All
Menu

This class is used to manage all animations. To avoid doubled animations that do the same, all animations are saved here in a Key-Value storage. Nodes only hold the string key of the animation.

Hierarchy

Index

Constructors

Private constructor

Properties

keys

keys: string[]

Used to show the available keys in the Manager. Mostly used for import.

lookup

lookup: {}

Represents the store of the data.

Type declaration

Static Private _instance

_instance: AnimationManager

Holds the instance of the AnimationManager.

Accessors

values

Static Instance

  • Returns the Instance of the AnimationManager or creates a new if none exists. Only one instance allowed.

    Returns AnimationManager

Methods

add

  • Saves a value in the Manager. Overrides existing values of the key.

    Parameters

    • key: string

      The key of the value

    • value: IAnimation

      The value to be saved

    Returns void

addIfNotExists

  • addIfNotExists(key: string, value: IAnimation): void
  • Adds a value if it not already exists within the storage.

    Parameters

    • key: string

      The key of the value

    • value: IAnimation

      The value to be saved

    Returns void

exists

  • exists(key: string): boolean
  • Checks if a key exists in the storage.

    Parameters

    • key: string

      The key to be checked.

    Returns boolean

get

  • Returns the value of a key or undefined if the key not exists.

    Parameters

    • key: string

      The key of the value to be returned.

    Returns IAnimation | undefined

getOrAdd

  • Checks for a key and returns its value or adds the default provided.

    Parameters

    • key: string

      The key of the value to be returned.

    • def: IAnimation

      Defaultvalue that should be added and returned, if the key not exists.

    Returns IAnimation

import

  • Imports data from another InputManager. Creates everything new because methods are lost after converting a class to JSON.

    Parameters

    • manager: AnimationManager

      The data of a Animationmanager to import into this one.

    Returns void

Private isDriver

  • Checks if it is the DriverAnimation.

    Parameters

    • o: IAnimation

      Any object that should be checked at the Import.

    Returns o is Driver

Private isJumper

  • Checks if it is the JumperAnimation.

    Parameters

    • o: IAnimation

      Any object that should be checked at the Import.

    Returns o is Jumper

Private isRotor

  • Checks if it is the RotorAnimation.

    Parameters

    • o: IAnimation

      Any object that should be checked at the Import.

    Returns o is Rotor

remove

  • remove(key: string): void
  • Removes a certain key from the storage.

    Parameters

    • key: string

      The key of the value to be removed.

    Returns void

updateAll

  • updateAll(delta: number): void
  • Updates all parameters of the Animations in store.

    Parameters

    • delta: number

      The timedelta since the last frame.

    Returns void

Generated using TypeDoc