]>
git.r.bdr.sh - rbdr/serpentity/blob - lib/serpentity/node.js
3 /* global Serpentity */
6 * A node describes a set of components in order to describe entities
9 let Node
= class Node
{
12 * Returns true if the given entity matches the defined protocol,
15 static matches (entity
) {
16 let types
= this.types
;
18 for (let typeName
in types
) {
19 if (types
.hasOwnProperty(typeName
)) {
22 let type
= types
[typeName
];
24 if (entity
.hasComponent(type
)) {
37 constructor (config
) {
40 Object
.assign(this, config
|| {});
44 if (typeof module
!== 'undefined' && this.module
!== module
) {
45 module
.exports
= Node
;
47 Serpentity
.Node
= Node
;