API Docs for: 0.1.0
Show:

zerk.game.engine.componentLoader Class

Component Loader

Builds component states.

Methods

buildComponents

(
  • entity
  • config
)
config.entity

Build the component states of an entity

Parameters:

Returns:

config.entity: The final entity state

init

(
  • jsonLoader
  • componentMap
)

Class constructor

Parameters:

  • jsonLoader zerk.jsonLoader

    JSON loader instance

  • componentMap Object

    Component name to class map

loadComponents

(
  • components
  • successHandler
  • errorHandler
)
async

Preloads given components

Parameters:

  • components Array

    Array of component names

  • successHandler Function

    Event handler for success

  • errorHandler Function

    Event handler for error

Properties

_component

Object protected

Component register

_componentMap

Object protected

Component name to class map

_jsonLoader

zerk.jsonLoader protected

JSON loader instance