@codehz/ecs 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -601,7 +601,12 @@ function matchesComponentTypes(archetype, componentTypes) {
|
|
|
601
601
|
return componentTypes.every((type) => {
|
|
602
602
|
const detailedType = getDetailedIdType(type);
|
|
603
603
|
if (detailedType.type === "wildcard-relation") {
|
|
604
|
-
return archetype.componentTypes.
|
|
604
|
+
return archetype.componentTypes.some((archetypeType) => {
|
|
605
|
+
if (!isRelationId(archetypeType))
|
|
606
|
+
return false;
|
|
607
|
+
const decoded = decodeRelationId(archetypeType);
|
|
608
|
+
return decoded.componentId === detailedType.componentId;
|
|
609
|
+
});
|
|
605
610
|
} else {
|
|
606
611
|
return archetype.componentTypes.includes(type);
|
|
607
612
|
}
|