@vworlds/vecs 1.0.13 → 1.0.14

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/README.md CHANGED
@@ -120,11 +120,12 @@ for (let tick = 0; tick < 5; tick++) {
120
120
 
121
121
  ## Deferred mode
122
122
 
123
- Inside a system body, a `Query.forEach`, or any `world.defer(...)` block, the world is in **deferred mode**: entity mutations (`add` / `set` / `remove` / `destroy` / `setParent` / `modified`) are queued instead of applied inline. The queue drains on the boundary that opened the deferred scope.
123
+ Inside a system body, a `Query.forEach`, or any `world.defer(...)` block, the world is in **deferred mode**: entity mutations (`add` / `attach` / `set` / `remove` / `destroy` / `setParent` / `modified`) are queued instead of applied inline. The queue drains on the boundary that opened the deferred scope.
124
124
 
125
125
  Concretely, while deferred:
126
126
 
127
127
  - `entity.get(C)` returns `undefined` after `entity.add(C)` (no instance has been created yet).
128
+ - `entity.get(C)` returns `undefined` after `entity.attach(instance)` if C was absent.
128
129
  - `entity.get(C)` returns the **previous** value after `entity.set(C, props)`.
129
130
  - `entity.get(C)` still returns the component after `entity.remove(C)`.
130
131
 
@@ -213,7 +214,7 @@ world
213
214
  .onSet((entity, sprite) => sprite.syncToScene(entity));
214
215
  ```
215
216
 
216
- `onAdd` fires when the component is first attached. `onRemove` fires when it is removed (or the entity is destroyed). `onSet` fires whenever `entity.modified(C)` is called, and when `entity.set(C, props)` is applied to an entity that already has the component. Hook callbacks receive the owning entity because component instances do not carry entity references.
217
+ `onAdd` fires when the component is first attached. `onRemove` fires when it is removed (or the entity is destroyed). `onSet` fires whenever `entity.modified(C)` is called, when `entity.set(C, props)` applies data, and when `entity.attach(instance)` stores an existing instance. Hook callbacks receive the owning entity because component instances do not carry entity references.
217
218
 
218
219
  #### Phases
219
220
 
@@ -384,15 +385,20 @@ entity.modified(Position); // tell the world this component changed
384
385
 
385
386
  // Equivalent — set assigns props and fires onSet automatically:
386
387
  entity.set(Position, { x: 100 });
388
+
389
+ // Store an existing instance directly:
390
+ const shared = new Position();
391
+ entity.attach(shared);
392
+ entity.get(Position) === shared; // true
387
393
  ```
388
394
 
389
- | Rule | Description |
390
- | ------------------------- | ------------------------------------------------------------------------------------------------------------- |
391
- | Plain class | Components should be ordinary classes with field initializers and methods as needed. |
392
- | No-arg construction | vecs calls `new ComponentClass()`, so constructors should be omitted or take no parameters. |
393
- | Explicit registration | Call `world.registerComponent(C)` before using the class as a component. |
394
- | Shared instances possible | A component instance does not know which entity owns it; code should use the entity passed by vecs callbacks. |
395
- | Manual dirty marking | After mutating fields directly, call `entity.modified(C)` to notify hooks, queries, and systems. |
395
+ | Rule | Description |
396
+ | ------------------------- | -------------------------------------------------------------------------------------------------------------- |
397
+ | Plain class | Components should be ordinary classes with field initializers and methods as needed. |
398
+ | No-arg construction | vecs calls `new ComponentClass()`, so constructors should be omitted or take no parameters. |
399
+ | Explicit registration | Call `world.registerComponent(C)` before using the class as a component. |
400
+ | Shared instances possible | `entity.attach(instance)` stores the exact passed object; code should use the entity passed by vecs callbacks. |
401
+ | Manual dirty marking | After mutating fields directly, call `entity.modified(C)` to notify hooks, queries, and systems. |
396
402
 
397
403
  Use `world.getComponentMeta(C)` or `world.getComponentType(C)` when you need metadata such as the numeric type id or component name. Metadata is world-specific.
398
404
 
@@ -409,6 +415,7 @@ Created via `world.entity()` (auto-assigned id) or `world.getOrCreateEntity(id,
409
415
  | `componentBitmask` | `Bitset` of component type ids attached to this entity. Used by archetype matching. |
410
416
  | `properties` | `Map<string, any>` free-form bag for module-level bookkeeping. |
411
417
  | `add(Class)` | Attach a component (idempotent). Returns the entity for chaining. |
418
+ | `attach(instance)` | Attach an existing registered component instance directly; replaces any previous instance for that component class and fires `onSet`. |
412
419
  | `set(Class, props)` | Attach a component and assign `props`; fires `onSet`. Returns the entity for chaining. |
413
420
  | `modified(Class)` | Queue an `onSet` / `update` notification for a component class or numeric type id. Returns the entity for chaining. |
414
421
  | `get(Class)` | Return the component instance, or `undefined`. |
@@ -430,6 +437,8 @@ vel.vx += accel;
430
437
  entity.modified(Velocity); // chainable
431
438
  ```
432
439
 
440
+ Use `entity.attach(instance)` when component ownership is intentionally shared with caller code or another object graph. The instance constructor must be registered in the entity's world; unregistered instances throw. If the component belongs to an exclusive component group, conflicting components are removed before the instance is stored.
441
+
433
442
  #### Parent / child hierarchy
434
443
 
435
444
  ```ts
package/dist/entity.d.ts CHANGED
@@ -19,18 +19,20 @@ type EntityEvents = Events<{
19
19
  * e.set(Position, { x: 100 });
20
20
  * ```
21
21
  *
22
- * Entities support a parentchild hierarchy. `parent` and `children` form a
22
+ * Entities support a parent-child hierarchy. `parent` and `children` form a
23
23
  * bidirectional link maintained by {@link setParent}; the children set is
24
24
  * created lazily. Destroying a parent recursively destroys its children.
25
25
  *
26
26
  * ## Deferred semantics
27
27
  *
28
28
  * Inside a system body or `forEach` iteration the world is in **deferred
29
- * mode**: `add` / `set` / `modified` / `remove` / `destroy` / `setParent` only
30
- * enqueue commands. The data layer (the components map and `componentBitmask`)
31
- * is mutated when the world drains its queue. Concretely, while deferred:
29
+ * mode**: `add` / `attach` / `set` / `modified` / `remove` / `destroy` /
30
+ * `setParent` only enqueue commands. The data layer (the components map and
31
+ * `componentBitmask`) is mutated when the world drains its queue. Concretely,
32
+ * while deferred:
32
33
  *
33
34
  * - `entity.get(C)` returns `undefined` after `entity.add(C)` (no instance yet).
35
+ * - `entity.get(C)` returns `undefined` after `entity.attach(instance)` if C was absent.
34
36
  * - `entity.get(C)` returns the previous value after `entity.set(C, props)`.
35
37
  * - `entity.get(C)` still returns the component after `entity.remove(C)`.
36
38
  *
@@ -57,11 +59,19 @@ export declare class Entity {
57
59
  world: World,
58
60
  /** Unique numeric entity id assigned at creation. */
59
61
  eid: number);
62
+ /** Fire every `onAdd` hook registered for `meta`. */
63
+ private _runOnAddHandlers;
64
+ /** Fire every `onSet` hook registered for `meta`. */
65
+ private _runOnSetHandlers;
60
66
  /**
61
67
  * Re-evaluate every world query for this entity, firing `_enter` / `_exit`
62
68
  * routing whenever membership flipped.
63
69
  */
64
70
  private _updateQueries;
71
+ /** Store a component instance and perform the shared add-side bookkeeping. */
72
+ private _storeComponent;
73
+ /** Perform the shared set-side hook and query update routing. */
74
+ private _notifyComponentSet;
65
75
  /**
66
76
  * Construct a fresh component of `type`, apply `props`, store it on this
67
77
  * entity, fire the `onAdd` hook, and route query updates.
@@ -70,57 +80,39 @@ export declare class Entity {
70
80
  * component already on this entity is removed first.
71
81
  */
72
82
  private _new;
73
- /** Parent entity in the scene hierarchy, or `undefined` for a root entity. */
74
- get parent(): Entity | undefined;
75
83
  /**
76
84
  * Read-only view of direct child entities. The backing set is created lazily
77
85
  * on the first child link; before that this getter returns a shared empty set.
78
86
  */
79
87
  get children(): ReadonlySet<Entity>;
80
- /**
81
- * Typed event emitter for entity-level lifecycle events. Currently only the
82
- * `"destroy"` event is emitted, just before the entity is fully torn down.
83
- *
84
- * The emitter is created lazily on first access.
85
- */
86
- get events(): EntityEvents;
87
- /** `true` when no components are currently attached to this entity. */
88
- get empty(): boolean;
89
88
  /**
90
89
  * Read-only view of all components currently attached to this entity, keyed
91
90
  * by numeric component type id.
92
91
  *
93
92
  * The mutating methods (`set`, `delete`, `clear`) are not exposed. Use
94
- * `entity.add`, `entity.set`, and `entity.remove` to change the component
95
- * set.
93
+ * `entity.add`, `entity.attach`, `entity.set`, and `entity.remove` to change
94
+ * the component set.
96
95
  *
97
96
  * ```ts
98
97
  * entity.components.forEach((c) => console.log(c.constructor.name));
99
98
  * ```
100
99
  */
101
100
  get components(): ReadonlyArrayMap<Component>;
101
+ /** `true` when no components are currently attached to this entity. */
102
+ get empty(): boolean;
102
103
  /**
103
- * Reparent this entity. In deferred mode the change is queued; outside
104
- * deferred mode it executes inline.
105
- *
106
- * @param newParent - New parent, or `undefined` to make this a root entity.
107
- */
108
- setParent(newParent: Entity | undefined): void;
109
- /**
110
- * Mark a component type as having changed, queueing the corresponding `onSet` / `update`
111
- * notifications.
112
- *
113
- * Repeated calls before the world routes the modified command are coalesced via
114
- * the entity's dirty component bitset.
104
+ * Typed event emitter for entity-level lifecycle events. Currently only the
105
+ * `"destroy"` event is emitted, just before the entity is fully torn down.
115
106
  *
116
- * @param typeOrClass - Component class or numeric type id whose data changed.
117
- * @returns This entity, for chaining.
107
+ * The emitter is created lazily on first access.
118
108
  */
119
- modified(typeOrClass: ComponentClassOrType): Entity;
109
+ get events(): EntityEvents;
110
+ /** Parent entity in the scene hierarchy, or `undefined` for a root entity. */
111
+ get parent(): Entity | undefined;
120
112
  /**
121
113
  * Attach a component to this entity if it is not already present.
122
114
  *
123
- * Idempotent. Does not fire `onSet` use {@link set} when you want to apply
115
+ * Idempotent. Does not fire `onSet` -- use {@link set} when you want to apply
124
116
  * data and notify watchers.
125
117
  *
126
118
  * @param Class - Component class to instantiate.
@@ -135,26 +127,44 @@ export declare class Entity {
135
127
  */
136
128
  add(type: number): Entity;
137
129
  /**
138
- * Attach a component (creating it if necessary), copy `props` onto the
139
- * instance, and fire the `onSet` hook plus any `update` callbacks for the
140
- * component type.
130
+ * Attach an existing component instance to this entity and store that exact
131
+ * object. If a component of the same registered class already exists, it is
132
+ * replaced rather than assigned into.
141
133
  *
142
- * In deferred mode `props` are not applied until the queued `Set` command is
143
- * routed.
134
+ * `attach` uses the instance constructor to resolve component metadata, so
135
+ * the constructor must already be registered in this world. The operation
136
+ * fires hooks and query updates like a `set` operation.
144
137
  *
145
- * @param Class - Component class to instantiate.
146
- * @param props - Properties to assign onto the component instance.
138
+ * @param component - Existing component instance to store on the entity.
147
139
  * @returns This entity, for chaining.
148
140
  */
149
- set<C extends ComponentClass>(Class: C, props: Partial<InstanceType<C>>): Entity;
141
+ attach(component: Component): Entity;
150
142
  /**
151
- * Attach a component by numeric type id and copy `props` onto it.
143
+ * Destroy this entity and recursively destroy its children.
152
144
  *
153
- * @param type - Numeric component type id.
154
- * @param props - Properties to assign onto the component instance.
145
+ * Each component fires its `onRemove` hook, the `"destroy"` event is emitted
146
+ * just before teardown, and the entity is unregistered from the world.
147
+ * After destruction the entity must not be used.
148
+ */
149
+ destroy(): void;
150
+ /**
151
+ * Look up a component on this entity.
152
+ *
153
+ * @param typeOrClass - Component class or numeric type id.
154
+ * @returns The component instance, or `undefined` when it is not attached.
155
+ */
156
+ get<C extends ComponentClass>(typeOrClass: number | C): InstanceType<C> | undefined;
157
+ /**
158
+ * Mark a component type as having changed, queueing the corresponding `onSet` / `update`
159
+ * notifications.
160
+ *
161
+ * Repeated calls before the world routes the modified command are coalesced via
162
+ * the entity's dirty component bitset.
163
+ *
164
+ * @param typeOrClass - Component class or numeric type id whose data changed.
155
165
  * @returns This entity, for chaining.
156
166
  */
157
- set(type: number, props: Partial<Component>): Entity;
167
+ modified(typeOrClass: ComponentClassOrType): Entity;
158
168
  /**
159
169
  * Detach a component from this entity.
160
170
  *
@@ -172,20 +182,33 @@ export declare class Entity {
172
182
  */
173
183
  remove(type: number): void;
174
184
  /**
175
- * Look up a component on this entity.
185
+ * Reparent this entity. In deferred mode the change is queued; outside
186
+ * deferred mode it executes inline.
176
187
  *
177
- * @param typeOrClass - Component class or numeric type id.
178
- * @returns The component instance, or `undefined` when it is not attached.
188
+ * @param newParent - New parent, or `undefined` to make this a root entity.
179
189
  */
180
- get<C extends ComponentClass>(typeOrClass: number | C): InstanceType<C> | undefined;
190
+ setParent(newParent: Entity | undefined): void;
181
191
  /**
182
- * Destroy this entity and recursively destroy its children.
192
+ * Attach a component (creating it if necessary), copy `props` onto the
193
+ * instance, and fire the `onSet` hook plus any `update` callbacks for the
194
+ * component type.
183
195
  *
184
- * Each component fires its `onRemove` hook, the `"destroy"` event is emitted
185
- * just before teardown, and the entity is unregistered from the world.
186
- * After destruction the entity must not be used.
196
+ * In deferred mode `props` are not applied until the queued `Set` command is
197
+ * routed.
198
+ *
199
+ * @param Class - Component class to instantiate.
200
+ * @param props - Properties to assign onto the component instance.
201
+ * @returns This entity, for chaining.
187
202
  */
188
- destroy(): void;
203
+ set<C extends ComponentClass>(Class: C, props: Partial<InstanceType<C>>): Entity;
204
+ /**
205
+ * Attach a component by numeric type id and copy `props` onto it.
206
+ *
207
+ * @param type - Numeric component type id.
208
+ * @param props - Properties to assign onto the component instance.
209
+ * @returns This entity, for chaining.
210
+ */
211
+ set(type: number, props: Partial<Component>): Entity;
189
212
  /** Returns `"EntityN"` where N is the entity id. */
190
213
  toString(): string;
191
214
  }
package/dist/entity.js CHANGED
@@ -14,18 +14,20 @@ import { Bitset } from "./util/bitset.js";
14
14
  * e.set(Position, { x: 100 });
15
15
  * ```
16
16
  *
17
- * Entities support a parentchild hierarchy. `parent` and `children` form a
17
+ * Entities support a parent-child hierarchy. `parent` and `children` form a
18
18
  * bidirectional link maintained by {@link setParent}; the children set is
19
19
  * created lazily. Destroying a parent recursively destroys its children.
20
20
  *
21
21
  * ## Deferred semantics
22
22
  *
23
23
  * Inside a system body or `forEach` iteration the world is in **deferred
24
- * mode**: `add` / `set` / `modified` / `remove` / `destroy` / `setParent` only
25
- * enqueue commands. The data layer (the components map and `componentBitmask`)
26
- * is mutated when the world drains its queue. Concretely, while deferred:
24
+ * mode**: `add` / `attach` / `set` / `modified` / `remove` / `destroy` /
25
+ * `setParent` only enqueue commands. The data layer (the components map and
26
+ * `componentBitmask`) is mutated when the world drains its queue. Concretely,
27
+ * while deferred:
27
28
  *
28
29
  * - `entity.get(C)` returns `undefined` after `entity.add(C)` (no instance yet).
30
+ * - `entity.get(C)` returns `undefined` after `entity.attach(instance)` if C was absent.
29
31
  * - `entity.get(C)` returns the previous value after `entity.set(C, props)`.
30
32
  * - `entity.get(C)` still returns the component after `entity.remove(C)`.
31
33
  *
@@ -59,6 +61,14 @@ export class Entity {
59
61
  /** @internal Set to `true` after the world has fully torn down this entity. */
60
62
  this._destroyed = false;
61
63
  }
64
+ /** Fire every `onAdd` hook registered for `meta`. */
65
+ _runOnAddHandlers(meta, component) {
66
+ meta._onAddHandlers?.forEach((handler) => handler(this, component));
67
+ }
68
+ /** Fire every `onSet` hook registered for `meta`. */
69
+ _runOnSetHandlers(meta, component) {
70
+ meta._onSetHandlers?.forEach((handler) => handler(this, component));
71
+ }
62
72
  /**
63
73
  * Re-evaluate every world query for this entity, firing `_enter` / `_exit`
64
74
  * routing whenever membership flipped.
@@ -66,20 +76,14 @@ export class Entity {
66
76
  _updateQueries() {
67
77
  this.world.queries.forEach((q) => {
68
78
  const belongs = q.belongs(this);
69
- const isIn = this._isInQuery(q);
79
+ const isIn = this._queries.has(q);
70
80
  if (belongs !== isIn) {
71
81
  belongs ? q._enter(this) : q._exit(this);
72
82
  }
73
83
  });
74
84
  }
75
- /**
76
- * Construct a fresh component of `type`, apply `props`, store it on this
77
- * entity, fire the `onAdd` hook, and route query updates.
78
- *
79
- * If the component type belongs to an exclusivity group, any conflicting
80
- * component already on this entity is removed first.
81
- */
82
- _new(meta, props) {
85
+ /** Store a component instance and perform the shared add-side bookkeeping. */
86
+ _storeComponent(meta, component, isAdd) {
83
87
  if (meta._exclusive) {
84
88
  for (const exclusiveMeta of meta._exclusive) {
85
89
  if (this._components.has(exclusiveMeta.type)) {
@@ -87,124 +91,55 @@ export class Entity {
87
91
  }
88
92
  }
89
93
  }
90
- const c = new meta.Class();
91
- if (props !== undefined) {
92
- Object.assign(c, props);
93
- }
94
- this._components.set(meta.type, c);
94
+ this._components.set(meta.type, component);
95
95
  this.componentBitmask.addBit(meta.bitPtr);
96
- if (meta._onAddHandlers) {
97
- meta._onAddHandlers.forEach((handler) => handler(this, c));
96
+ if (isAdd) {
97
+ this._runOnAddHandlers(meta, component);
98
98
  }
99
99
  this._updateQueries();
100
- return c;
101
100
  }
102
- /**
103
- * @internal Return `true` when this entity is currently tracked by `q`.
104
- */
105
- _isInQuery(q) {
106
- return this._queries.has(q);
107
- }
108
- /**
109
- * @internal Look up a component instance by numeric type id.
110
- *
111
- * Faster than {@link get} because no class → type id resolution is needed.
112
- */
113
- _get(type) {
114
- return this._components.get(type);
115
- }
116
- /**
117
- * @internal Reparent this entity in place, maintaining the bidirectional
118
- * link. Throws if `newParent` is a descendant of this entity.
119
- *
120
- * Called by the world either inline (outside deferred mode) or while
121
- * routing a queued `SetParent` command.
122
- */
123
- _setParent(newParent) {
124
- if (this._destroyed) {
125
- return;
126
- }
127
- if (newParent !== undefined) {
128
- let ancestor = newParent;
129
- while (ancestor !== undefined) {
130
- if (ancestor === this) {
131
- throw new Error(`Circular parent reference: entity ${this.eid} is already an ancestor of entity ${newParent.eid}`);
132
- }
133
- ancestor = ancestor._parent;
134
- }
135
- }
136
- if (this._parent) {
137
- this._parent._children?.delete(this);
138
- }
139
- this._parent = newParent;
140
- if (newParent) {
141
- (newParent._children ?? (newParent._children = new Set())).add(this);
101
+ /** Perform the shared set-side hook and query update routing. */
102
+ _notifyComponentSet(meta, component, isUpdate) {
103
+ this._runOnSetHandlers(meta, component);
104
+ this._dirtyComponentBitmask.deleteBit(meta.bitPtr);
105
+ if (isUpdate) {
106
+ this._queries.forEach((q) => q._notifyModified(this, meta, component));
142
107
  }
143
108
  }
144
109
  /**
145
- * @internal Apply a `Set` command: create the component if missing, assign
146
- * `props` if provided, fire `onSet`, and route modified events to every
147
- * query that watches the component type.
110
+ * Construct a fresh component of `type`, apply `props`, store it on this
111
+ * entity, fire the `onAdd` hook, and route query updates.
112
+ *
113
+ * If the component type belongs to an exclusivity group, any conflicting
114
+ * component already on this entity is removed first.
148
115
  */
149
- _set(meta, props) {
150
- if (this._destroyed) {
151
- return;
152
- }
153
- const existing = this._components.get(meta.type);
154
- const c = existing ?? this._new(meta, props);
116
+ _new(meta, props) {
117
+ const c = new meta.Class();
155
118
  if (props !== undefined) {
156
- if (existing) {
157
- Object.assign(c, props);
158
- }
159
- const setHandlers = meta._onSetHandlers;
160
- if (setHandlers) {
161
- setHandlers.forEach((handler) => handler(this, c));
162
- }
163
- this._dirtyComponentBitmask.deleteBit(meta.bitPtr);
164
- if (existing) {
165
- this._queries.forEach((q) => q._notifyModified(this, meta, c));
166
- }
119
+ Object.assign(c, props);
167
120
  }
121
+ this._storeComponent(meta, c, true);
122
+ return c;
168
123
  }
169
124
  /**
170
- * @internal Apply a `Modified` command: fire `onSet` and route modified
171
- * events to every query that watches the component type.
125
+ * @internal Record that this entity is now tracked by `q`. Called by
126
+ * `Query._enter`.
172
127
  */
173
- _modified(meta) {
174
- if (this._destroyed) {
175
- return;
176
- }
177
- const c = this._components.get(meta.type);
178
- if (!c) {
179
- return;
180
- }
181
- const setHandlers = meta._onSetHandlers;
182
- if (setHandlers) {
183
- setHandlers.forEach((handler) => handler(this, c));
184
- }
185
- this._dirtyComponentBitmask.deleteBit(meta.bitPtr);
186
- this._queries.forEach((q) => q._notifyModified(this, meta, c));
128
+ _addQueryMembership(q) {
129
+ this._queries.add(q);
187
130
  }
188
131
  /**
189
- * @internal Apply a `Remove` command: clear the type bit, route exits,
190
- * detach the component, and fire `onRemove`.
132
+ * @internal Apply an `Attach` command: store the provided component instance,
133
+ * replacing any previous instance for this type. Events are fired as if the
134
+ * caller had performed a `set` operation.
191
135
  */
192
- _remove(meta) {
136
+ _attach(meta, component) {
193
137
  if (this._destroyed) {
194
138
  return;
195
139
  }
196
- const c = this._components.get(meta.type);
197
- if (!c) {
198
- return;
199
- }
200
- this._dirtyComponentBitmask.deleteBit(meta.bitPtr);
201
- this.componentBitmask.deleteBit(meta.bitPtr);
202
- this._updateQueries();
203
- this._components.delete(meta.type);
204
- const removeHandlers = meta._onRemoveHandlers;
205
- if (removeHandlers) {
206
- removeHandlers.forEach((handler) => handler(this, c));
207
- }
140
+ const existing = this._components.get(meta.type);
141
+ this._storeComponent(meta, component, existing === undefined);
142
+ this._notifyComponentSet(meta, component, existing !== undefined);
208
143
  }
209
144
  /**
210
145
  * @internal Apply a `Destroy` command: fire `_exit` on every query, then
@@ -241,6 +176,34 @@ export class Entity {
241
176
  this._parent = undefined;
242
177
  }
243
178
  }
179
+ /**
180
+ * @internal Look up a component instance by numeric type id.
181
+ *
182
+ * Faster than {@link get} because no class to type id resolution is needed.
183
+ */
184
+ _get(type) {
185
+ return this._components.get(type);
186
+ }
187
+ /**
188
+ * @internal Return `true` when this entity is currently tracked by `q`.
189
+ */
190
+ _isInQuery(q) {
191
+ return this._queries.has(q);
192
+ }
193
+ /**
194
+ * @internal Apply a `Modified` command: fire `onSet` and route modified
195
+ * events to every query that watches the component type.
196
+ */
197
+ _modified(meta) {
198
+ if (this._destroyed) {
199
+ return;
200
+ }
201
+ const c = this._components.get(meta.type);
202
+ if (!c) {
203
+ return;
204
+ }
205
+ this._notifyComponentSet(meta, c, true);
206
+ }
244
207
  /**
245
208
  * @internal Forget query `q` without firing exit callbacks. Called by
246
209
  * {@link World} when a {@link Query.destroy} sweeps every entity.
@@ -249,11 +212,25 @@ export class Entity {
249
212
  this._queries.delete(q);
250
213
  }
251
214
  /**
252
- * @internal Record that this entity is now tracked by `q`. Called by
253
- * `Query._enter`.
215
+ * @internal Apply a `Remove` command: clear the type bit, route exits,
216
+ * detach the component, and fire `onRemove`.
254
217
  */
255
- _addQueryMembership(q) {
256
- this._queries.add(q);
218
+ _remove(meta) {
219
+ if (this._destroyed) {
220
+ return;
221
+ }
222
+ const c = this._components.get(meta.type);
223
+ if (!c) {
224
+ return;
225
+ }
226
+ this._dirtyComponentBitmask.deleteBit(meta.bitPtr);
227
+ this.componentBitmask.deleteBit(meta.bitPtr);
228
+ this._updateQueries();
229
+ this._components.delete(meta.type);
230
+ const removeHandlers = meta._onRemoveHandlers;
231
+ if (removeHandlers) {
232
+ removeHandlers.forEach((handler) => handler(this, c));
233
+ }
257
234
  }
258
235
  /**
259
236
  * @internal Record that this entity is no longer tracked by `q`. Called by
@@ -262,9 +239,51 @@ export class Entity {
262
239
  _removeQueryMembership(q) {
263
240
  this._queries.delete(q);
264
241
  }
265
- /** Parent entity in the scene hierarchy, or `undefined` for a root entity. */
266
- get parent() {
267
- return this._parent;
242
+ /**
243
+ * @internal Apply a `Set` command: create the component if missing, assign
244
+ * `props` if provided, fire `onSet`, and route modified events to every
245
+ * query that watches the component type.
246
+ */
247
+ _set(meta, props) {
248
+ if (this._destroyed) {
249
+ return;
250
+ }
251
+ const existing = this._components.get(meta.type);
252
+ const c = existing ?? this._new(meta, props);
253
+ if (props !== undefined) {
254
+ if (existing) {
255
+ Object.assign(c, props);
256
+ }
257
+ this._notifyComponentSet(meta, c, existing !== undefined);
258
+ }
259
+ }
260
+ /**
261
+ * @internal Reparent this entity in place, maintaining the bidirectional
262
+ * link. Throws if `newParent` is a descendant of this entity.
263
+ *
264
+ * Called by the world either inline (outside deferred mode) or while
265
+ * routing a queued `SetParent` command.
266
+ */
267
+ _setParent(newParent) {
268
+ if (this._destroyed) {
269
+ return;
270
+ }
271
+ if (newParent !== undefined) {
272
+ let ancestor = newParent;
273
+ while (ancestor !== undefined) {
274
+ if (ancestor === this) {
275
+ throw new Error(`Circular parent reference: entity ${this.eid} is already an ancestor of entity ${newParent.eid}`);
276
+ }
277
+ ancestor = ancestor._parent;
278
+ }
279
+ }
280
+ if (this._parent) {
281
+ this._parent._children?.delete(this);
282
+ }
283
+ this._parent = newParent;
284
+ if (newParent) {
285
+ (newParent._children ?? (newParent._children = new Set())).add(this);
286
+ }
268
287
  }
269
288
  /**
270
289
  * Read-only view of direct child entities. The backing set is created lazily
@@ -273,6 +292,25 @@ export class Entity {
273
292
  get children() {
274
293
  return this._children ?? Entity._emptyChildren;
275
294
  }
295
+ /**
296
+ * Read-only view of all components currently attached to this entity, keyed
297
+ * by numeric component type id.
298
+ *
299
+ * The mutating methods (`set`, `delete`, `clear`) are not exposed. Use
300
+ * `entity.add`, `entity.attach`, `entity.set`, and `entity.remove` to change
301
+ * the component set.
302
+ *
303
+ * ```ts
304
+ * entity.components.forEach((c) => console.log(c.constructor.name));
305
+ * ```
306
+ */
307
+ get components() {
308
+ return this._components;
309
+ }
310
+ /** `true` when no components are currently attached to this entity. */
311
+ get empty() {
312
+ return this._components.size == 0;
313
+ }
276
314
  /**
277
315
  * Typed event emitter for entity-level lifecycle events. Currently only the
278
316
  * `"destroy"` event is emitted, just before the entity is fully torn down.
@@ -285,38 +323,72 @@ export class Entity {
285
323
  }
286
324
  return this._events;
287
325
  }
288
- /** `true` when no components are currently attached to this entity. */
289
- get empty() {
290
- return this._components.size == 0;
326
+ /** Parent entity in the scene hierarchy, or `undefined` for a root entity. */
327
+ get parent() {
328
+ return this._parent;
329
+ }
330
+ add(typeOrClass) {
331
+ const meta = this.world.getComponentMeta(typeOrClass);
332
+ if (this.world.deferred) {
333
+ this.world._enqueue({ kind: 1 /* CommandKind.Set */, entity: this, meta, props: undefined });
334
+ }
335
+ else {
336
+ this._set(meta, undefined);
337
+ }
338
+ return this;
291
339
  }
292
340
  /**
293
- * Read-only view of all components currently attached to this entity, keyed
294
- * by numeric component type id.
341
+ * Attach an existing component instance to this entity and store that exact
342
+ * object. If a component of the same registered class already exists, it is
343
+ * replaced rather than assigned into.
295
344
  *
296
- * The mutating methods (`set`, `delete`, `clear`) are not exposed. Use
297
- * `entity.add`, `entity.set`, and `entity.remove` to change the component
298
- * set.
345
+ * `attach` uses the instance constructor to resolve component metadata, so
346
+ * the constructor must already be registered in this world. The operation
347
+ * fires hooks and query updates like a `set` operation.
299
348
  *
300
- * ```ts
301
- * entity.components.forEach((c) => console.log(c.constructor.name));
302
- * ```
349
+ * @param component - Existing component instance to store on the entity.
350
+ * @returns This entity, for chaining.
303
351
  */
304
- get components() {
305
- return this._components;
352
+ attach(component) {
353
+ const meta = this.world.getComponentMeta(component.constructor);
354
+ if (this.world.deferred) {
355
+ this.world._enqueue({ kind: 6 /* CommandKind.Attach */, entity: this, meta, component });
356
+ }
357
+ else {
358
+ this._attach(meta, component);
359
+ }
360
+ return this;
306
361
  }
307
362
  /**
308
- * Reparent this entity. In deferred mode the change is queued; outside
309
- * deferred mode it executes inline.
363
+ * Destroy this entity and recursively destroy its children.
310
364
  *
311
- * @param newParent - New parent, or `undefined` to make this a root entity.
365
+ * Each component fires its `onRemove` hook, the `"destroy"` event is emitted
366
+ * just before teardown, and the entity is unregistered from the world.
367
+ * After destruction the entity must not be used.
312
368
  */
313
- setParent(newParent) {
369
+ destroy() {
314
370
  if (this.world.deferred) {
315
- this.world._enqueue({ kind: 5 /* CommandKind.SetParent */, entity: this, parent: newParent });
371
+ this.world._enqueue({ kind: 4 /* CommandKind.Destroy */, entity: this });
316
372
  }
317
373
  else {
318
- this._setParent(newParent);
374
+ this._destroy();
319
375
  }
376
+ if (this._children) {
377
+ this._children.forEach((child) => {
378
+ child.destroy();
379
+ });
380
+ this._children.clear();
381
+ }
382
+ }
383
+ /**
384
+ * Look up a component on this entity.
385
+ *
386
+ * @param typeOrClass - Component class or numeric type id.
387
+ * @returns The component instance, or `undefined` when it is not attached.
388
+ */
389
+ get(typeOrClass) {
390
+ const type = this.world.getComponentType(typeOrClass);
391
+ return this._get(type);
320
392
  }
321
393
  /**
322
394
  * Mark a component type as having changed, queueing the corresponding `onSet` / `update`
@@ -342,26 +414,6 @@ export class Entity {
342
414
  }
343
415
  return this;
344
416
  }
345
- add(typeOrClass) {
346
- const meta = this.world.getComponentMeta(typeOrClass);
347
- if (this.world.deferred) {
348
- this.world._enqueue({ kind: 1 /* CommandKind.Set */, entity: this, meta, props: undefined });
349
- }
350
- else {
351
- this._set(meta, undefined);
352
- }
353
- return this;
354
- }
355
- set(typeOrClass, props) {
356
- const meta = this.world.getComponentMeta(typeOrClass);
357
- if (this.world.deferred) {
358
- this.world._enqueue({ kind: 1 /* CommandKind.Set */, entity: this, meta, props });
359
- }
360
- else {
361
- this._set(meta, props);
362
- }
363
- return this;
364
- }
365
417
  remove(typeOrClass) {
366
418
  const meta = this.world.getComponentMeta(typeOrClass);
367
419
  if (this.world.deferred) {
@@ -372,35 +424,28 @@ export class Entity {
372
424
  }
373
425
  }
374
426
  /**
375
- * Look up a component on this entity.
376
- *
377
- * @param typeOrClass - Component class or numeric type id.
378
- * @returns The component instance, or `undefined` when it is not attached.
379
- */
380
- get(typeOrClass) {
381
- const type = this.world.getComponentType(typeOrClass);
382
- return this._get(type);
383
- }
384
- /**
385
- * Destroy this entity and recursively destroy its children.
427
+ * Reparent this entity. In deferred mode the change is queued; outside
428
+ * deferred mode it executes inline.
386
429
  *
387
- * Each component fires its `onRemove` hook, the `"destroy"` event is emitted
388
- * just before teardown, and the entity is unregistered from the world.
389
- * After destruction the entity must not be used.
430
+ * @param newParent - New parent, or `undefined` to make this a root entity.
390
431
  */
391
- destroy() {
432
+ setParent(newParent) {
392
433
  if (this.world.deferred) {
393
- this.world._enqueue({ kind: 4 /* CommandKind.Destroy */, entity: this });
434
+ this.world._enqueue({ kind: 5 /* CommandKind.SetParent */, entity: this, parent: newParent });
394
435
  }
395
436
  else {
396
- this._destroy();
437
+ this._setParent(newParent);
397
438
  }
398
- if (this._children) {
399
- this._children.forEach((child) => {
400
- child.destroy();
401
- });
402
- this._children.clear();
439
+ }
440
+ set(typeOrClass, props) {
441
+ const meta = this.world.getComponentMeta(typeOrClass);
442
+ if (this.world.deferred) {
443
+ this.world._enqueue({ kind: 1 /* CommandKind.Set */, entity: this, meta, props });
403
444
  }
445
+ else {
446
+ this._set(meta, props);
447
+ }
448
+ return this;
404
449
  }
405
450
  /** Returns `"EntityN"` where N is the entity id. */
406
451
  toString() {
@@ -1 +1 @@
1
- {"version":3,"file":"entity.js","sourceRoot":"","sources":["../src/entity.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAoB,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,OAAO,MAAM;IAkCjB;IACE,mCAAmC;IACnB,KAAY;IAC5B,qDAAqD;IACrC,GAAW;QAFX,UAAK,GAAL,KAAK,CAAO;QAEZ,QAAG,GAAH,GAAG,CAAQ;QArC7B,sEAAsE;QAC9D,gBAAW,GAAG,IAAI,QAAQ,EAAa,CAA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,qBAAc,GAAwB,IAAI,GAAG,EAAE,CAAC"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vworlds/vecs",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
package/dist/world.d.ts CHANGED
@@ -45,7 +45,7 @@ import { IPhase } from "./phase.js";
45
45
  * ## Deferred mode
46
46
  *
47
47
  * The world can be in **deferred mode**, in which case entity mutations
48
- * (`add` / `set` / `remove` / `destroy` / `setParent` / `modified`) are
48
+ * (`add` / `attach` / `set` / `remove` / `destroy` / `setParent` / `modified`) are
49
49
  * queued instead of applied inline. Systems run inside an automatically
50
50
  * deferred scope; user code can wrap arbitrary blocks with
51
51
  * {@link beginDefer} / {@link endDefer} or {@link defer}. {@link flush}
package/dist/world.js CHANGED
@@ -52,7 +52,7 @@ const LOCAL_COMPONENT_MIN = 256;
52
52
  * ## Deferred mode
53
53
  *
54
54
  * The world can be in **deferred mode**, in which case entity mutations
55
- * (`add` / `set` / `remove` / `destroy` / `setParent` / `modified`) are
55
+ * (`add` / `attach` / `set` / `remove` / `destroy` / `setParent` / `modified`) are
56
56
  * queued instead of applied inline. Systems run inside an automatically
57
57
  * deferred scope; user code can wrap arbitrary blocks with
58
58
  * {@link beginDefer} / {@link endDefer} or {@link defer}. {@link flush}
@@ -139,6 +139,9 @@ export class World {
139
139
  case 5 /* CommandKind.SetParent */:
140
140
  cmd.entity._setParent(cmd.parent);
141
141
  return;
142
+ case 6 /* CommandKind.Attach */:
143
+ cmd.entity._attach(cmd.meta, cmd.component);
144
+ return;
142
145
  }
143
146
  }
144
147
  /**
package/dist/world.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"world.js","sourceRoot":"","sources":["../src/world.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,aAAa,EAAQ,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,MAAM,EAAE,MA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AC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED;;;;OAIG;IACI,QAAQ;QACb,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC1B,MAAM,2CAA2C,CAAC;SACnD;QACD,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;IAChC,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACI,QAAQ,CAAC,KAAa,EAAE,GAAW,EAAE,KAAa;QACvD,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC1B,MAAM,6DAA6D,CAAC;SACrE;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,KAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACrC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACI,QAAQ,CAAC,GAAW,EAAE,KAAa;QACxC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI;YACF,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC/B,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;gBAAS;YACR,IAAI,CAAC,QAAQ,EAAE,CAAC;SACjB;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vworlds/vecs",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",