@codehz/ecs 0.3.11 → 0.3.13

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.d.mts CHANGED
@@ -50,16 +50,6 @@ declare function isRelationId<T>(id: EntityId<T>): id is RelationId<T>;
50
50
  * Check if an ID is a wildcard relation id
51
51
  */
52
52
  declare function isWildcardRelationId<T>(id: EntityId<T>): id is WildcardRelationId<T>;
53
- /**
54
- * Decode a relation ID into component and target IDs
55
- * @param relationId The relation ID (must be negative)
56
- * @returns Object with componentId, targetId, and relation type
57
- */
58
- declare function decodeRelationId(relationId: RelationId<any>): {
59
- componentId: ComponentId<any>;
60
- targetId: EntityId<any>;
61
- type: "entity" | "component" | "wildcard";
62
- };
63
53
  /**
64
54
  * Component options that define intrinsic properties
65
55
  */
@@ -649,9 +639,6 @@ declare class World<UpdateParams extends any[] = []> {
649
639
  * Remove all relations with the same base component (for exclusive relations)
650
640
  */
651
641
  private removeExclusiveRelations;
652
- /**
653
- * Check if a component type is a relation with the given base component
654
- */
655
642
  private isRelationWithComponent;
656
643
  /**
657
644
  * Process a delete command, handling wildcard relations
@@ -661,6 +648,11 @@ declare class World<UpdateParams extends any[] = []> {
661
648
  * Remove all relations matching a wildcard component ID
662
649
  */
663
650
  private removeWildcardRelations;
651
+ /**
652
+ * Remove a single component from an entity immediately, handling dontFragment relations correctly.
653
+ * Used by destroyEntityImmediate for non-cascade relation cleanup.
654
+ */
655
+ private removeComponentImmediate;
664
656
  /**
665
657
  * Apply changeset to entity, moving to new archetype if needed
666
658
  * @returns Map of removed components with their data
@@ -675,13 +667,10 @@ declare class World<UpdateParams extends any[] = []> {
675
667
  */
676
668
  private updateEntityInSameArchetype;
677
669
  /**
678
- * Check if changeset contains dontFragment relation changes
679
- */
680
- private hasDontFragmentChanges;
681
- /**
682
- * Remove and re-add entity with updated components (for dontFragment changes)
670
+ * Apply dontFragment relation changes directly to World's storage
671
+ * This is much more efficient than the removeEntity + addEntity approach
683
672
  */
684
- private readdEntityWithUpdatedComponents;
673
+ private applyDontFragmentChanges;
685
674
  /**
686
675
  * Update entity reference tracking based on changeset
687
676
  */
@@ -780,5 +769,5 @@ type SerializedComponent = {
780
769
  value: any;
781
770
  };
782
771
  //#endregion
783
- export { type ComponentId, type ComponentOptions, type ComponentRelationId, type ComponentTuple, type ComponentType, type EntityId, type EntityRelationId, type LifecycleHook, Query, type RelationId, type SerializedWorld, type System, type WildcardRelationId, World, component, decodeRelationId, getComponentIdByName, getComponentNameById, isComponentId, isEntityId, isRelationId, isWildcardRelationId, relation };
772
+ export { type ComponentId, type ComponentOptions, type ComponentRelationId, type ComponentTuple, type ComponentType, type EntityId, type EntityRelationId, type LifecycleHook, Query, type RelationId, type SerializedWorld, type System, type WildcardRelationId, World, component, getComponentIdByName, getComponentNameById, isComponentId, isEntityId, isRelationId, isWildcardRelationId, relation };
784
773
  //# sourceMappingURL=index.d.mts.map