@codehz/ecs 0.3.6 → 0.3.7
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/archetype.d.ts +1 -4
- package/index.js +1 -1
- package/package.json +1 -1
- package/query.d.ts +1 -4
package/archetype.d.ts
CHANGED
|
@@ -140,10 +140,7 @@ export declare class Archetype {
|
|
|
140
140
|
* implemented as a generator returning each entity/components pair lazily
|
|
141
141
|
* @param componentTypes Array of component types to retrieve
|
|
142
142
|
*/
|
|
143
|
-
iterateWithComponents<const T extends readonly ComponentType<any>[]>(componentTypes: T): IterableIterator<
|
|
144
|
-
entity: EntityId;
|
|
145
|
-
components: ComponentTuple<T>;
|
|
146
|
-
}>;
|
|
143
|
+
iterateWithComponents<const T extends readonly ComponentType<any>[]>(componentTypes: T): IterableIterator<[EntityId, ...ComponentTuple<T>]>;
|
|
147
144
|
/**
|
|
148
145
|
* Iterate over entities with their component data for specified component types
|
|
149
146
|
* Optimized for bulk component access
|
package/index.js
CHANGED
|
@@ -479,7 +479,7 @@ class Archetype {
|
|
|
479
479
|
for (let entityIndex = 0;entityIndex < this.entities.length; entityIndex++) {
|
|
480
480
|
const entity = this.entities[entityIndex];
|
|
481
481
|
const components = this.buildComponentsForIndex(componentTypes, componentDataSources, entityIndex);
|
|
482
|
-
yield
|
|
482
|
+
yield [entity, ...components];
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
485
|
forEachWithComponents(componentTypes, callback) {
|
package/package.json
CHANGED
package/query.d.ts
CHANGED
|
@@ -36,10 +36,7 @@ export declare class Query {
|
|
|
36
36
|
* Iterate over entities with their component data (generator)
|
|
37
37
|
* @param componentTypes Array of component types to retrieve
|
|
38
38
|
*/
|
|
39
|
-
iterate<const T extends readonly ComponentType<any>[]>(componentTypes: T): IterableIterator<
|
|
40
|
-
entity: EntityId;
|
|
41
|
-
components: ComponentTuple<T>;
|
|
42
|
-
}>;
|
|
39
|
+
iterate<const T extends readonly ComponentType<any>[]>(componentTypes: T): IterableIterator<[EntityId, ...ComponentTuple<T>]>;
|
|
43
40
|
/**
|
|
44
41
|
* Get component data arrays for all matching entities
|
|
45
42
|
* @param componentType The component type to retrieve
|