Tag
Tag
Stores textual tags, useful for tagging entities.
Kind: global class
- Tag
- instance
- .count ⇒
number - .get(i) ⇒
string - .add(value) ⇒
boolean - .addAll(values)
- .getFirst() ⇒
string - .contains(value) ⇒
boolean - .containsAll(values)
- .containsOneOf(values) ⇒
boolean - .getValues() ⇒
Array.<string> - .traverse(visitor, [thisArg])
- .hash() ⇒
number - .equals(other) ⇒
boolean - .fromJSON(json)
- .count ⇒
- static
- .typeName :
string - .find(tags, ecd) ⇒
Array.<number> - .fromOne(tag) ⇒
Tag - .fromJSON(json) ⇒
Tag - .from(...label) ⇒
Tag
- .typeName :
- instance
tag.count ⇒ number
Kind: instance property of Tag
tag.get(i) ⇒ string
Kind: instance method of Tag
| Param | Type |
|---|---|
| i | number |
tag.add(value) ⇒ boolean
Once the tag is added to the dataset it should be considered immutable, hence why this method is protected
Kind: instance method of Tag
| Param | Type |
|---|---|
| value | string |
tag.addAll(values)
Add multiple tags
Kind: instance method of Tag
| Param | Type |
|---|---|
| values | Array.<string> |
tag.getFirst() ⇒ string
Kind: instance method of Tag
tag.contains(value) ⇒ boolean
Kind: instance method of Tag
| Param | Type |
|---|---|
| value | string |
tag.containsAll(values)
Kind: instance method of Tag
| Param | Type |
|---|---|
| values | Array.<string> |
tag.containsOneOf(values) ⇒ boolean
Kind: instance method of Tag
| Param | Type |
|---|---|
| values | Array.<string> |
tag.getValues() ⇒ Array.<string>
NOTE: do not modify this value
Kind: instance method of Tag
tag.traverse(visitor, [thisArg])
Kind: instance method of Tag
| Param | Type |
|---|---|
| visitor | function |
| [thisArg] | * |
tag.hash() ⇒ number
Kind: instance method of Tag
tag.equals(other) ⇒ boolean
Kind: instance method of Tag
| Param | Type |
|---|---|
| other | Tag |
tag.fromJSON(json)
Kind: instance method of Tag
| Param | Type |
|---|---|
| json | Array.<string> | string |
Tag.typeName : string
Kind: static property of Tag
Read only: true
Tag.find(tags, ecd) ⇒ Array.<number>
Find all entities that contain specified tags. Entity must have every tag to qualify
Kind: static method of Tag
Returns: Array.<number> - entities
| Param | Type |
|---|---|
| tags | Array.<string> |
| ecd | EntityComponentDataset |
Tag.fromOne(tag) ⇒ Tag
Kind: static method of Tag
| Param | Type |
|---|---|
| tag | string |
Tag.fromJSON(json) ⇒ Tag
Kind: static method of Tag
| Param |
|---|
| json |
Tag.from(...label) ⇒ Tag
Utility constructor
Kind: static method of Tag
| Param | Type |
|---|---|
| ...label | string |