Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AssetLoader

Provides managing all promise on initializing resources.

Hierarchy

  • EEObject
    • AssetLoader

Implements

  • EventEmitter

Index

Constructors

constructor

  • Returns AssetLoader

Properties

addListener

addListener: function

Type declaration

    • (event: string, listener: Function): this
    • Parameters

      • event: string
      • listener: Function

      Returns this

completeCount

completeCount: number = 0

Promise count completed(success and errored)

type

{number}

emit

emit: function

Type declaration

    • (event: string, ...args: any[]): boolean
    • Parameters

      • event: string
      • Rest ...args: any[]

      Returns boolean

errorCount

errorCount: number = 0

Promise count errored

type

{number}

eventNames

eventNames: function

Type declaration

    • (): string[]
    • Returns string[]

getMaxListeners

getMaxListeners: function

Type declaration

    • (): number
    • Returns number

id

id: string

ID related to this instance to identify.

listenerCount

listenerCount: function

Type declaration

    • (type: string): number
    • Parameters

      • type: string

      Returns number

listeners

listeners: function

Type declaration

    • (event: string): Function[]
    • Parameters

      • event: string

      Returns Function[]

loadCount

loadCount: number = 0

Promise count finished successfully.

type

{number}

on

on: function

Type declaration

    • (event: string, listener: Function): this
    • Parameters

      • event: string
      • listener: Function

      Returns this

once

once: function

Type declaration

    • (event: string, listener: Function): this
    • Parameters

      • event: string
      • listener: Function

      Returns this

prependListener

prependListener: function

Type declaration

    • (event: string, listener: Function): this
    • Parameters

      • event: string
      • listener: Function

      Returns this

prependOnceListener

prependOnceListener: function

Type declaration

    • (event: string, listener: Function): this
    • Parameters

      • event: string
      • listener: Function

      Returns this

promise

promise: Promise<void> = new Promise<void>((resolve) => { this._resolve = resolve; })

Main promise to provide tasks for waiting for all resource loading.

type

{Promise}

registerCount

registerCount: number = 0

Promise count registered.

type

{number}

removeAllListeners

removeAllListeners: function

Type declaration

    • (event?: string): this
    • Parameters

      • Optional event: string

      Returns this

removeListener

removeListener: function

Type declaration

    • (event: string, listener: Function): this
    • Parameters

      • event: string
      • listener: Function

      Returns this

setMaxListeners

setMaxListeners: function

Type declaration

    • (n: number): this
    • Parameters

      • n: number

      Returns this

Methods

getTypeName

  • getTypeName(): string
  • Obtain class name

    Returns string

    Class name of the instance.

register

  • register<T>(promise: Promise<T>, component: Component): Promise<T>
  • Register an promise to be waited until finished.

    Type parameters

    • T

    Parameters

    • promise: Promise<T>
    • component: Component

    Returns Promise<T>

toString

  • toString(): string
  • Obtain stringfied object. If this method was not overridden, this method return class name.

    Returns string

    stringfied object

Static getUniqueRandom

  • getUniqueRandom(length: number): string
  • Generate random string

    Parameters

    • length: number

      length of random string

    Returns string

    generated string

Generated using TypeDoc