@codehz/ecs 0.0.6 → 0.0.9
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/entity.d.ts +1 -1
- package/package.json +1 -1
- package/world.d.ts +8 -3
package/entity.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare function createEntityId(id: number): EntityId;
|
|
|
47
47
|
/**
|
|
48
48
|
* Type for relation ID based on component and target types
|
|
49
49
|
*/
|
|
50
|
-
type RelationIdType<T, R> = R extends ComponentId<infer U> ? U extends void ? ComponentRelationId<T> : ComponentRelationId<T & U> : R extends EntityId<any> ? EntityRelationId<T> : never;
|
|
50
|
+
type RelationIdType<T, R> = R extends ComponentId<infer U> ? U extends void ? ComponentRelationId<T> : ComponentRelationId<T extends void ? U : T & U> : R extends EntityId<any> ? EntityRelationId<T> : never;
|
|
51
51
|
/**
|
|
52
52
|
* Create a relation ID by associating a component with another ID (entity or component)
|
|
53
53
|
* @param componentId The component ID (0-1023)
|
package/package.json
CHANGED
package/world.d.ts
CHANGED
|
@@ -70,11 +70,16 @@ export declare class World<ExtraParams extends any[] = [deltaTime: number]> {
|
|
|
70
70
|
*/
|
|
71
71
|
hasComponent<T>(entityId: EntityId, componentType: EntityId<T>): boolean;
|
|
72
72
|
/**
|
|
73
|
-
* Get
|
|
73
|
+
* Get component data for a specific entity and wildcard relation type
|
|
74
|
+
* Returns an array of all matching relation instances
|
|
75
|
+
* @param entityId The entity
|
|
76
|
+
* @param componentType The wildcard relation type
|
|
74
77
|
*/
|
|
75
|
-
getComponent<T>(entityId: EntityId, componentType: WildcardRelationId<T>): [EntityId<unknown>,
|
|
78
|
+
getComponent<T>(entityId: EntityId, componentType: WildcardRelationId<T>): [EntityId<unknown>, T][];
|
|
76
79
|
/**
|
|
77
|
-
* Get a
|
|
80
|
+
* Get component data for a specific entity and component type
|
|
81
|
+
* @param entityId The entity
|
|
82
|
+
* @param componentType The component type
|
|
78
83
|
*/
|
|
79
84
|
getComponent<T>(entityId: EntityId, componentType: EntityId<T>): T;
|
|
80
85
|
/**
|