@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.
Files changed (2) hide show
  1. package/index.js +6 -1
  2. 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.includes(detailedType.componentId);
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codehz/ecs",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",