API Docs for: 0.1.0
Show:

zerk.game.engine.entityLoader Class

Entity Loader

Provides entity defintions.

Methods

_loadComponents

(
  • entities
  • components
  • successHandler
  • errorHandler
)
protected async

Loads the given components

Parameters:

  • entities Array

    Array of entities

  • components Array

    Array of components

  • successHandler Function

    Event handler for success

  • errorHandler Function

    Event handler for error

_onLoadEntities

(
  • entities
  • successHandler
  • errorHandler
)
protected async

Fires when entities are loaded

Parameters:

  • entities Array

    Array of entities

  • successHandler Function

    Event handler for success

  • errorHandler Function

    Event handler for error

getComponentList

(
  • entity
)
Array

Returns a list of components contained in the entity

Parameters:

Returns:

Array: Array of components

getEntity

(
  • name
)
config.entity

Returns a preloaded entity

Parameters:

  • name String

    Entity name

Returns:

config.entity: The entity definition

init

(
  • jsonLoader
  • componentLoader
)

Class constructor

Parameters:

loadEntities

(
  • entities
  • successHandler
  • errorHandler
)
async

Preloads given entities

Parameters:

  • entities Array

    Array of entities

  • successHandler Function

    Event handler for success

  • errorHandler Function

    Event handler for error

Properties

_componentLoader

zerk.game.engine.componentLoader protected

Component loader instance

_jsonLoader

zerk.jsonLoader protected

JSON loader instance