zerk.game.engine.entityLoader Class
Entity Loader
Provides entity defintions.
Item Index
Properties
Methods
_loadComponents
(
protected
async
-
entities
-
components
-
successHandler
-
errorHandler
Loads the given components
Parameters:
-
entities
ArrayArray of entities
-
components
ArrayArray of components
-
successHandler
FunctionEvent handler for success
-
errorHandler
FunctionEvent handler for error
_onLoadEntities
(
protected
async
-
entities
-
successHandler
-
errorHandler
Fires when entities are loaded
Parameters:
-
entities
ArrayArray of entities
-
successHandler
FunctionEvent handler for success
-
errorHandler
FunctionEvent handler for error
getComponentList
(
Array
-
entity
Returns a list of components contained in the entity
Parameters:
-
entity
config.entityEntity state
Returns:
Array:
Array of components
getEntity
(
config.entity
-
name
Returns a preloaded entity
Parameters:
-
name
StringEntity name
Returns:
config.entity:
The entity definition
init
(
-
jsonLoader
-
componentLoader
Class constructor
Parameters:
-
jsonLoader
zerk.jsonLoaderJSON loader instance
-
componentLoader
zerk.game.engine.componentLoaderComponent loader instance
loadEntities
(
async
-
entities
-
successHandler
-
errorHandler
Preloads given entities
Parameters:
-
entities
ArrayArray of entities
-
successHandler
FunctionEvent handler for success
-
errorHandler
FunctionEvent handler for error