new Module()
- Source:
- core/module.js, line 20
Members
-
$c
-
Describe Component
- Source:
- core/module.js, line 56
Example
module.$c('Goblin', { gold: 100, health: 50, wisdom: 10 });
-
$name :string
-
Name of the Module
- Source:
- core/module.js, line 29
-
$s
-
Describe System. Like a filter in AngularJS
- Source:
- core/module.js, line 119
- See:
Example
module.$s('theSystem', { //define array of requiested component $require: ['theComponent1', 'theComponent2'] //(optional) execute on adding system $added: function() { }, //(optional) execute on removing system $removed: function() { }, //(optional) execute on adding entity to system $addEntity: function($entity) { }, //(optional) execute on removing entity from system $removeEntity: function($entity) { }, //(optional) beforeUpdate //before function define all injections (angularjs style) $beforeUpdate: ['$entities', function($entities) { }], //(optional) handle each entity in the system. //before function define all injections (angularjs style) $update: ['#entity', '$world', function($entity, $world) { }], //(optional) afterUpdate //before function define all injections (angularjs style) $afterUpdate: ['$entities', function($entities) { }] });
Methods
-
$has(name) → {boolean}
-
Define is module has component or system.
Parameters:
Name Type Description name
string of component or system
- Source:
- core/module.js, line 37
Returns:
- Type
- boolean