@daneren2005/shared-memory-physics 1.6.0 → 1.6.1

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/dist/world.d.ts CHANGED
@@ -11,20 +11,20 @@ export interface PhysicalSystemWorld extends EntityWorkerSystemWorld, PhysicalWo
11
11
  export interface PhysicalWorldSource {
12
12
  spatialMap: SharedSpatialMap;
13
13
  }
14
- export type PhysicalWorldOptions<R extends ComponentDefinitionMap> = WorldOptions<ComponentsOf<R>, EntityConfigOf<R>> & {
14
+ export type PhysicalWorldOptions<R extends ComponentDefinitionMap, E extends BaseEntity<ComponentsOf<R>, EntityConfigOf<R>> = BaseEntity<ComponentsOf<R>, EntityConfigOf<R>>> = WorldOptions<ComponentsOf<R>, EntityConfigOf<R>, E> & {
15
15
  spatial?: SharedSpatialMapConfig;
16
16
  };
17
- export type PhysicalWorldEntity<R extends ComponentDefinitionMap> = BaseEntity<ComponentsOf<R>, EntityConfigOf<R>>;
18
- export type PhysicalWorldFilter<R extends ComponentDefinitionMap> = (entity: PhysicalWorldEntity<R>) => boolean;
17
+ export type PhysicalWorldEntity<R extends ComponentDefinitionMap, E extends BaseEntity<ComponentsOf<R>, EntityConfigOf<R>> = BaseEntity<ComponentsOf<R>, EntityConfigOf<R>>> = E;
18
+ export type PhysicalWorldFilter<R extends ComponentDefinitionMap, E extends BaseEntity<ComponentsOf<R>, EntityConfigOf<R>> = BaseEntity<ComponentsOf<R>, EntityConfigOf<R>>> = (entity: PhysicalWorldEntity<R, E>) => boolean;
19
19
  export declare function addPhysicalWorldData(source: PhysicalWorldSource, target: PhysicalWorldData): void;
20
20
  export declare function getSpatialMap(world: PhysicalSystemWorld): SharedSpatialMap;
21
- export default class PhysicalWorld<R extends ComponentDefinitionMap> extends BaseWorld<R> implements PhysicalWorldSource {
21
+ export default class PhysicalWorld<R extends ComponentDefinitionMap, E extends BaseEntity<ComponentsOf<R>, EntityConfigOf<R>> = BaseEntity<ComponentsOf<R>, EntityConfigOf<R>>> extends BaseWorld<R, ComponentsOf<R>, EntityConfigOf<R>, E> implements PhysicalWorldSource {
22
22
  readonly spatialMap: SharedSpatialMap;
23
23
  private spatialIds;
24
- constructor(registry: R, options?: PhysicalWorldOptions<R>);
25
- updateSpatialEntity(entityOrId: PhysicalWorldEntity<R> | number): void;
26
- searchSpatial(minX: number, minY: number, maxX: number, maxY: number, filter?: PhysicalWorldFilter<R>): Array<PhysicalWorldEntity<R>>;
27
- searchSpatialAround(x: number, y: number, reachX: number, reachY: number, filter?: PhysicalWorldFilter<R>): Array<PhysicalWorldEntity<R>>;
28
- findNearestSpatial(x: number, y: number, maxDistance?: number, filter?: PhysicalWorldFilter<R>): PhysicalWorldEntity<R> | undefined;
29
- findNearbySpatial(x: number, y: number, maxResults: number, maxDistance?: number, filter?: PhysicalWorldFilter<R>): Array<PhysicalWorldEntity<R>>;
24
+ constructor(registry: R, options?: PhysicalWorldOptions<R, E>);
25
+ updateSpatialEntity(entityOrId: PhysicalWorldEntity<R, E> | number): void;
26
+ searchSpatial(minX: number, minY: number, maxX: number, maxY: number, filter?: PhysicalWorldFilter<R, E>): Array<PhysicalWorldEntity<R, E>>;
27
+ searchSpatialAround(x: number, y: number, reachX: number, reachY: number, filter?: PhysicalWorldFilter<R, E>): Array<PhysicalWorldEntity<R, E>>;
28
+ findNearestSpatial(x: number, y: number, maxDistance?: number, filter?: PhysicalWorldFilter<R, E>): PhysicalWorldEntity<R, E> | undefined;
29
+ findNearbySpatial(x: number, y: number, maxResults: number, maxDistance?: number, filter?: PhysicalWorldFilter<R, E>): Array<PhysicalWorldEntity<R, E>>;
30
30
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@daneren2005/shared-memory-physics",
3
3
  "description": "2D physics components and systems built on the shared-memory ECS.",
4
4
  "author": "Scott Jackson",
5
- "version": "1.6.0",
5
+ "version": "1.6.1",
6
6
  "type": "module",
7
7
  "sideEffects": false,
8
8
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "prepare": "husky"
42
42
  },
43
43
  "devDependencies": {
44
- "@daneren2005/shared-memory-ecs": "^1.6.0",
44
+ "@daneren2005/shared-memory-ecs": "^1.7.0",
45
45
  "@daneren2005/shared-memory-objects": "^1.5.0",
46
46
  "@semantic-release/git": "^10.0.1",
47
47
  "@stylistic/eslint-plugin": "^5.10.0",