SystemStore

SystemStore

new SystemStore(opts)

Source:

Centralized place for registering and creating systems.

For internal use only!

Parameters:
Name Type Description
opts Object
Properties
Name Type Description
game Entropy

game instance

Members

(private) _factories :Object

Source:

Object with factories for system types.

Type:
  • Object

game :Entropy

Source:

Game instance injected to constructor.

Type:

Methods

create(type, …args) → {System}

Source:

Creates new entity instance or acquires one from pool.

Parameters:
Name Type Attributes Description
type String

type of system to create

args Any <repeatable>

arguments passed to onCreate method

Returns:

new system ready to be added to engine

Type
System

register(descriptor)

Source:

Registers system.

Parameters:
Name Type Description
descriptor Object

object describing system

Properties
Name Type Description
type String

type of system

onCreate function

method called when system is created

onRemove function

method called when system is removed

onUpdate function

method called when system is updated

registerMany(descriptiors)

Source:

Registeres many systems.

Parameters:
Name Type Description
descriptiors Array

array of system's descriptors (see SystemStore#register)