Entity

general purpose object

new ocs.Entity(environment, name, limit);


Parameter Type Description Default
environment String / Number name of the Environment to add the Entity to
name String / Number unique name of the Entity
limit Int (OPTIONAL) limit of key depth when adding Components 3

Methods

Properties


Methods

addTag

add a Tag to this Entity

ocs.Entity.addTag(tag);


Parameter Type Description
tag String / Number Tag to add

hasTag

return if this Entity has a given Tag

ocs.Entity.hasTag(tag);


Parameter Type Description
tag String / Number Tag to check

removeTag

remove a Tag from this Entity

ocs.Entity.removeTag(tag);


Parameter Type Description
tag String / Number Tag to remove

printTags

return an array of all the Tags this Entity has

ocs.Entity.printTags();

addComponent

add a component to this Entity

ocs.Entity.addComponent(component, ...params);


Parameter Type Description
component String / Number Component to add
...params any params to pass to the Component builder

hasComponent

returns if this Entity has a specific Component

ocs.Entity.hasComponent(component);


Parameter Type Description
component String / Number name of the Component

removeComponent

removes a Component from this Entity

ocs.Entity.removeComponent(component);


Parameter Type Description
component String / Number name of the Component

printComponents

returns an array of the names of all the Components this Entity has

ocs.Entity.printComponents();

destroy

destroy this Entity

ocs.Entity.destroy();


Properties

name

reference to the name of the Entity

ocs.Entity.name

environment

reference to the Environment this Entity is a part of

ocs.Entity.environment