]>
git.r.bdr.sh - rbdr/serpentity/blob - lib/serpentity/node.js
796eee53c276993b7299240cc351b513dfbba68b
4 * A node describes a set of components in order to describe entities
7 const Node
= class Node
{
10 * Returns true if the given entity matches the defined protocol,
13 static matches(entity
) {
15 const typeNames
= Object
.keys(this.types
);
17 for (const typeName
of typeNames
) {
19 const type
= this.types
[typeName
];
22 if (entity
.hasComponent(type
)) {
38 Object
.assign(this, config
);
42 module
.exports
= Node
;