]>
git.r.bdr.sh - rbdr/serpentity/blob - lib/serpentity/node.js
db33f171d677b5c5e439380809b555496dee7a3d
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
) {
20 for (property
in types
) {
21 if (types
.hasOwnProperty(property
)) {
25 type
= types
[property
];
26 if (entity
.hasComponent(type
)) {
38 constructor (config
) {
41 Object
.assign(this, config
|| {});
45 if (typeof module
!== 'undefined' && this.module
!== module
) {
46 module
.exports
= Node
;
48 Serpentity
.Node
= Node
;