Environment

environment

new ocs.Environment(name);


Parameter Type Description
name String / Number unique name of the Environment

Methods

Properties


Methods

getComponent

get a specific component in this Environment

ocs.Environment.getComponent(name);


Parameter Type Description
name String / Number name of the component

addComponent

duplicates a component from another environment and adds it to itself

ocs.Environment.addComponent(environment, component);


Parameter Type Description
environment String / Number name of the environment to duplicate the component from
component String / Number name of the component to duplicate

hasComponent

returns if the environment contains a component with a given name

ocs.Environment.hasComponent(component);


Parameter Type Description
component String / Number name of the component

removeComponent

removes a component from the Environment, and from all the Entities in this Environment

ocs.Environment.removeComponent(component);


Parameter Type Description
component String / Number name of the component

printComponents

returns an array containing the names of all the Components in this Environment.

ocs.Environment.printComponents();

addEntity

creates a new Entity and adds it to this Environment

ocs.Environment.addEntity(entity);


Parameter Type Description
entity String / Number unique name of this new Entity

getEntity

gets a specific entity in the Environment

ocs.Environment.getEntity(entity);


Parameter Type Description
entity String / Number name of the Entity

printEntities

returns an array containing the names of all the Entities in this Environment.

ocs.Environment.printEntities();


Properties

name

String / Number

reference to the name of the Environment

ocs.Environment.name