Class: Entity

Entity

Entity is bag of game property in one instance.
For example instance of bonus with component position in (ng2D).

new Entity()

Source:
  • core/entity.js, line 15

Members

<private> $$world :World

World of entity

Source:
  • core/entity.js, line 30

$name :string

Name of entity

Source:
  • core/entity.js, line 23

Methods

$add(value, config) → {Component}

Add new Component to entity

Parameters:
Name Type Argument Description
value string | Component

The name of the Component or

config object <optional>

The config of adding Component

Source:
  • core/entity.js, line 46
Returns:
Type
Component
Example
 entity.$add('ng2D', {
   x: 1.0,
   y: 3.0
 });

$has(value) → {boolean}

Is entity has component

Parameters:
Name Type Description
value string | Component

The name or instance of component test

Source:
  • core/entity.js, line 117
Returns:
Type
boolean

$remove(value) → {Component}

Remove component from entity

Parameters:
Name Type Description
value string | Component

The name or instance of component

Source:
  • core/entity.js, line 86
Returns:
Type
Component
Example
 entity.$remove('ngVisible');

comments powered by Disqus