Class: Aspect

Aspect


new Aspect()

An Aspect is used by systems as a matcher to check if this one is interested by the entity.

Author:
  • episanchez

Members


<static> allSet :Array.<Number>

The entity must have all component of this set

Type:
  • Array.<Number>

<static> excludeSet :Array.<Number>

The entity must haven't all component of this set

Type:
  • Array.<Number>

<static> oneSet :Array.<Number>

The entity must have one component of this set

Type:
  • Array.<Number>

Methods


buildAll(ComponentSet)

Build all ids set

Parameters:
Name Type Description
ComponentSet Array.<Number>

Set of components' id


buildExclude(ComponentSet)

Build exclude ids set

Parameters:
Name Type Description
ComponentSet Array.<Number>

Set of components' id


buildOne(ComponentSet)

Build one ids set

Parameters:
Name Type Description
ComponentSet Array.<Number>

Set of components' id


buildWithStrResult(StringFormat)

Build an Aspect with the next string format : 1,2,3#4,5#6,7
That means, this aspect has all of [1,2,3], has one of [4,5], exclude all of [6,7]

Parameters:
Name Type Description
StringFormat string

String Formated with previous format


getAllIds()

Get all Ids

Returns:

Set of all interested ids

Type
Array.<Number>

getExcludeIds()

Get Exclude Ids

Returns:

Set of exclude ids

Type
Array.<Number>

getOneIds()

Get One Ids

Returns:

Set of one interested ids

Type
Array.<Number>

isInterested(entity)

Match the interest with the entity

Parameters:
Name Type Description
entity Entity

Entity instance