Class: ComponentManager

ComponentManager


new ComponentManager()

It used in the world for manage all your component class

Author:
  • : episanchez

Extends

Members


<static> componentsByType :Array.<Array>

current last id

Type:
  • Array.<Array>

<static> componentsType :number

current last id

Type:
  • number

<static> idx :number

current last id

Type:
  • number
Default Value:
  • 0

Methods


addComponentByName(entity, name)

Add component with his name to the entity

Parameters:
Name Type Description
entity Entity

Entity that we insert a new component

name string

Name of ComponentType


begin()

Begin processing of system

Inherited From:

checkProcessing()

Check if the system could be process.

Inherited From:

create(obj)

Create a new ComponentType

Parameters:
Name Type Description
obj Object

Class of Component


disable()

Disable System

Inherited From:

enable()

Enable system

Inherited From:

end()

End Processing of system

Inherited From:

getAllComponentsByUID(set)

Get All components of an entity by its uid

Parameters:
Name Type Description
set number

set of Entity Components' set

Returns:

Array of Entity Components Set

Type
Array.<Number>

getComponentTypeByName(name)

get Component Type by name

Parameters:
Name Type Description
name string

Name of the componenty type

Returns:
Type
ComponentType

getEnabled()

Give the status boolean of system

Inherited From:
Returns:

IsEnable

Type
boolean

getWorld()

Get the World
return {World}

Inherited From:

initialize()

Initialization of the manager (register it in the aspectSubscriptionManager)

Inherited From:

insert(id)

Implement insert entity event

Parameters:
Name Type Description
id number

id of entity

Overrides:

inserted(ids)

Inserted Subscription Listener (call the insert methods for each ids)

Parameters:
Name Type Description
ids Array.<Number>

Array of entity ids

Inherited From:

isComponentTypeExist(componentName)

get the result if the componentType exists

Parameters:
Name Type Description
componentName string

Name of component

Since:
  • 0.0.5
Returns:
Type
boolean

process()

Processing of system, calls if check processing is true : begin, processSystem, end methods

Inherited From:

<abstract> processSystem()

Process the system
Have to be impemented

Inherited From:

remove(id)

Implement remove entity event

Parameters:
Name Type Description
id number

id of entity

Overrides:

removeAllComponentsByEntity(entity)

Remove All Components of one Entity

Parameters:
Name Type Description
entity Entity

Entity that we remove all its components


removeComponentByName(entity, name)

Remove component with his name to the entity

Parameters:
Name Type Description
entity Entity

Entity that we remove one of its component

name string

Name of ComponentType


removeComponentType(name)

Remove a Component Type

Parameters:
Name Type Description
name string

Name of Component Type


removed(ids)

Removed Subscription Listener (call the remove methods for each ids)

Parameters:
Name Type Description
ids Array.<Number>

Array of entity ids

Inherited From:

removeEntityComponentsSetByValue(set, value)

Remove each value among the set parameters to the componentsByType array

Parameters:
Name Type Description
set Array.<Number>

set of Entity Components' set

value number

value has to be remove


setWorld(world)

Set a world to the system

Parameters:
Name Type Description
world World

-

Inherited From: