iris-ecs 0.0.2 → 0.0.4
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 +47 -45
- package/dist/component.js +11 -11
- package/dist/component.js.map +1 -1
- package/dist/entity.d.ts +3 -2
- package/dist/entity.d.ts.map +1 -1
- package/dist/entity.js +7 -7
- package/dist/entity.js.map +1 -1
- package/dist/error.d.ts +129 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +150 -0
- package/dist/error.js.map +1 -0
- package/dist/event.d.ts +23 -7
- package/dist/event.d.ts.map +1 -1
- package/dist/event.js +36 -12
- package/dist/event.js.map +1 -1
- package/dist/filters.d.ts +0 -16
- package/dist/filters.d.ts.map +1 -1
- package/dist/filters.js +0 -29
- package/dist/filters.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/name.d.ts +2 -1
- package/dist/name.d.ts.map +1 -1
- package/dist/name.js +5 -7
- package/dist/name.js.map +1 -1
- package/dist/query.d.ts +43 -36
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +97 -72
- package/dist/query.js.map +1 -1
- package/dist/registry.d.ts +3 -3
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +7 -12
- package/dist/registry.js.map +1 -1
- package/dist/relation.d.ts.map +1 -1
- package/dist/relation.js +2 -1
- package/dist/relation.js.map +1 -1
- package/dist/removal.d.ts +2 -2
- package/dist/removal.js +2 -2
- package/dist/scheduler.d.ts.map +1 -1
- package/dist/scheduler.js +18 -21
- package/dist/scheduler.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -41,11 +41,11 @@ import {
|
|
|
41
41
|
addComponent,
|
|
42
42
|
getComponentValue,
|
|
43
43
|
setComponentValue,
|
|
44
|
-
|
|
44
|
+
queryEntities,
|
|
45
45
|
addSystem,
|
|
46
46
|
runOnce,
|
|
47
47
|
Type,
|
|
48
|
-
} from "iris-ecs";
|
|
48
|
+
} from "iris-ecs";
|
|
49
49
|
|
|
50
50
|
// Define components
|
|
51
51
|
const Position = defineComponent("Position", { x: Type.f32(), y: Type.f32() });
|
|
@@ -62,7 +62,7 @@ addComponent(world, player, Player);
|
|
|
62
62
|
|
|
63
63
|
// Define a system
|
|
64
64
|
function movementSystem(world) {
|
|
65
|
-
|
|
65
|
+
queryEntities(world, [Position, Velocity], (e) => {
|
|
66
66
|
const px = getComponentValue(world, e, Position, "x");
|
|
67
67
|
const py = getComponentValue(world, e, Position, "y");
|
|
68
68
|
const vx = getComponentValue(world, e, Velocity, "x");
|
|
@@ -70,7 +70,7 @@ function movementSystem(world) {
|
|
|
70
70
|
|
|
71
71
|
setComponentValue(world, e, Position, "x", px + vx);
|
|
72
72
|
setComponentValue(world, e, Position, "y", py + vy);
|
|
73
|
-
}
|
|
73
|
+
});
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// Register and run
|
|
@@ -246,9 +246,9 @@ if (hasResource(world, Time)) {
|
|
|
246
246
|
Resources use the **component-on-self pattern** internally -- the component is added to itself as an entity. This means resources appear in queries:
|
|
247
247
|
|
|
248
248
|
```typescript
|
|
249
|
-
|
|
249
|
+
queryEntities(world, [Time], (entity) => {
|
|
250
250
|
// entity === Time (the component ID itself)
|
|
251
|
-
}
|
|
251
|
+
});
|
|
252
252
|
```
|
|
253
253
|
|
|
254
254
|
Use resources for frame timing, configuration, asset registry, input state, physics settings, or any global data that systems need but doesn't belong to a specific entity.
|
|
@@ -262,7 +262,7 @@ import {
|
|
|
262
262
|
defineRelation,
|
|
263
263
|
pair,
|
|
264
264
|
addComponent,
|
|
265
|
-
|
|
265
|
+
queryEntities,
|
|
266
266
|
getRelationTargets,
|
|
267
267
|
Wildcard,
|
|
268
268
|
} from "iris-ecs";
|
|
@@ -277,9 +277,9 @@ addComponent(world, player, pair(ChildOf, scene));
|
|
|
277
277
|
addComponent(world, weapon, pair(ChildOf, player));
|
|
278
278
|
|
|
279
279
|
// Query children of a specific parent
|
|
280
|
-
|
|
280
|
+
queryEntities(world, [pair(ChildOf, scene)], (child) => {
|
|
281
281
|
// child === player
|
|
282
|
-
}
|
|
282
|
+
});
|
|
283
283
|
|
|
284
284
|
// Get all targets for a relation on an entity
|
|
285
285
|
const parents = getRelationTargets(world, weapon, ChildOf); // [player]
|
|
@@ -292,11 +292,13 @@ Use relations for hierarchies (parent/child), ownership, targeting, dependencies
|
|
|
292
292
|
Use `Wildcard` to match any relation or target:
|
|
293
293
|
|
|
294
294
|
```typescript
|
|
295
|
+
import { collectEntities } from "iris-ecs";
|
|
296
|
+
|
|
295
297
|
// All entities with ANY ChildOf relation (any target)
|
|
296
|
-
const allChildren =
|
|
298
|
+
const allChildren = collectEntities(world, [pair(ChildOf, Wildcard)]);
|
|
297
299
|
|
|
298
300
|
// All entities targeting a specific entity (any relation)
|
|
299
|
-
const relatedToPlayer =
|
|
301
|
+
const relatedToPlayer = collectEntities(world, [pair(Wildcard, player)]);
|
|
300
302
|
```
|
|
301
303
|
|
|
302
304
|
#### Exclusive Relations
|
|
@@ -372,19 +374,19 @@ Adding or removing a component moves an entity to a different archetype. This is
|
|
|
372
374
|
|
|
373
375
|
### Queries
|
|
374
376
|
|
|
375
|
-
A **Query** fetches entities that match a set of component constraints. Use `
|
|
377
|
+
A **Query** fetches entities that match a set of component constraints. Use `queryEntities()` to iterate matches, `queryFirstEntity()` for singletons, or `collectEntities()` for array results.
|
|
376
378
|
|
|
377
379
|
```typescript
|
|
378
|
-
import {
|
|
380
|
+
import { queryEntities, queryFirstEntity, not } from "iris-ecs";
|
|
379
381
|
|
|
380
382
|
// Iterate all entities with Position and Velocity
|
|
381
|
-
|
|
383
|
+
queryEntities(world, [Position, Velocity], (entity) => {
|
|
382
384
|
const x = getComponentValue(world, entity, Position, "x");
|
|
383
385
|
// ...
|
|
384
|
-
}
|
|
386
|
+
});
|
|
385
387
|
|
|
386
388
|
// Get a singleton (first match or undefined)
|
|
387
|
-
const player =
|
|
389
|
+
const player = queryFirstEntity(world, [Player, not(Dead)]);
|
|
388
390
|
```
|
|
389
391
|
|
|
390
392
|
💡 **Tip:** Queries are cached internally -- the same component set returns the same cached query.
|
|
@@ -395,14 +397,14 @@ Use `not()` to exclude entities that have a component:
|
|
|
395
397
|
|
|
396
398
|
```typescript
|
|
397
399
|
// All entities with Position but WITHOUT the Dead tag
|
|
398
|
-
|
|
400
|
+
queryEntities(world, [Position, not(Dead)], (entity) => {
|
|
399
401
|
// Only living entities
|
|
400
|
-
}
|
|
402
|
+
});
|
|
401
403
|
|
|
402
404
|
// Multiple exclusions
|
|
403
|
-
|
|
405
|
+
queryEntities(world, [Position, Velocity, not(Frozen), not(Disabled)], (entity) => {
|
|
404
406
|
// Entities that can move
|
|
405
|
-
}
|
|
407
|
+
});
|
|
406
408
|
```
|
|
407
409
|
|
|
408
410
|
#### Filters and Archetypes (Under the Hood)
|
|
@@ -418,13 +420,13 @@ import {
|
|
|
418
420
|
addSystem,
|
|
419
421
|
run,
|
|
420
422
|
stop,
|
|
421
|
-
|
|
423
|
+
queryEntities,
|
|
422
424
|
getComponentValue,
|
|
423
425
|
setComponentValue,
|
|
424
426
|
} from "iris-ecs";
|
|
425
427
|
|
|
426
428
|
function movementSystem(world) {
|
|
427
|
-
|
|
429
|
+
queryEntities(world, [Position, Velocity], (e) => {
|
|
428
430
|
const px = getComponentValue(world, e, Position, "x");
|
|
429
431
|
const py = getComponentValue(world, e, Position, "y");
|
|
430
432
|
const vx = getComponentValue(world, e, Velocity, "x");
|
|
@@ -432,7 +434,7 @@ function movementSystem(world) {
|
|
|
432
434
|
|
|
433
435
|
setComponentValue(world, e, Position, "x", px + vx);
|
|
434
436
|
setComponentValue(world, e, Position, "y", py + vy);
|
|
435
|
-
}
|
|
437
|
+
});
|
|
436
438
|
}
|
|
437
439
|
|
|
438
440
|
addSystem(world, movementSystem);
|
|
@@ -468,7 +470,7 @@ Without constraints, systems run in registration order. Use arrays for multiple
|
|
|
468
470
|
Systems are grouped into **schedules** -- named execution phases. The default pipeline runs these schedules every frame:
|
|
469
471
|
|
|
470
472
|
```
|
|
471
|
-
First
|
|
473
|
+
First -> PreUpdate -> Update -> PostUpdate -> Last
|
|
472
474
|
```
|
|
473
475
|
|
|
474
476
|
`Update` is the default schedule. Assign systems to other phases based on when they should run:
|
|
@@ -511,7 +513,7 @@ const Physics = defineSchedule("Physics");
|
|
|
511
513
|
insertScheduleAfter(world, Physics, PreUpdate);
|
|
512
514
|
addSystem(world, gravitySystem, { schedule: Physics });
|
|
513
515
|
|
|
514
|
-
// Pipeline is now: First
|
|
516
|
+
// Pipeline is now: First -> PreUpdate -> Physics -> Update -> PostUpdate -> Last
|
|
515
517
|
```
|
|
516
518
|
|
|
517
519
|
#### Running the World
|
|
@@ -576,7 +578,7 @@ Actions are initialized lazily and cached per world -- calling `spawnActions(wor
|
|
|
576
578
|
An **Event** is an ephemeral message for communication between systems. Unlike components (persistent data on entities), events are fire-and-forget: emit once, consume once per system, then gone.
|
|
577
579
|
|
|
578
580
|
```typescript
|
|
579
|
-
import { defineEvent, emitEvent,
|
|
581
|
+
import { defineEvent, emitEvent, readEvents, Type } from "iris-ecs";
|
|
580
582
|
|
|
581
583
|
// Tag event (no data)
|
|
582
584
|
const GameStarted = defineEvent("GameStarted");
|
|
@@ -593,9 +595,9 @@ emitEvent(world, DamageDealt, { target: enemy, amount: 25 });
|
|
|
593
595
|
|
|
594
596
|
// Consume events in a system
|
|
595
597
|
function damageSystem(world) {
|
|
596
|
-
|
|
598
|
+
readEvents(world, DamageDealt, (event) => {
|
|
597
599
|
applyDamage(event.target, event.amount);
|
|
598
|
-
}
|
|
600
|
+
});
|
|
599
601
|
}
|
|
600
602
|
```
|
|
601
603
|
|
|
@@ -607,15 +609,15 @@ Each system independently tracks which events it has consumed. Multiple systems
|
|
|
607
609
|
|
|
608
610
|
```typescript
|
|
609
611
|
function uiSystem(world) {
|
|
610
|
-
|
|
612
|
+
readEvents(world, DamageDealt, (e) => {
|
|
611
613
|
showDamageNumber(e.target, e.amount);
|
|
612
|
-
}
|
|
614
|
+
});
|
|
613
615
|
}
|
|
614
616
|
|
|
615
617
|
function audioSystem(world) {
|
|
616
|
-
|
|
618
|
+
readEvents(world, DamageDealt, (e) => {
|
|
617
619
|
playHitSound(e.amount);
|
|
618
|
-
}
|
|
620
|
+
});
|
|
619
621
|
}
|
|
620
622
|
|
|
621
623
|
// Both systems see the same DamageDealt events
|
|
@@ -627,7 +629,7 @@ function audioSystem(world) {
|
|
|
627
629
|
import {
|
|
628
630
|
hasEvents,
|
|
629
631
|
countEvents,
|
|
630
|
-
|
|
632
|
+
readLastEvent,
|
|
631
633
|
clearEvents,
|
|
632
634
|
} from "iris-ecs";
|
|
633
635
|
|
|
@@ -637,7 +639,7 @@ if (hasEvents(world, DamageDealt)) {
|
|
|
637
639
|
}
|
|
638
640
|
|
|
639
641
|
// Get only the most recent event (marks all as read)
|
|
640
|
-
const lastInput =
|
|
642
|
+
const lastInput = readLastEvent(world, InputChanged);
|
|
641
643
|
|
|
642
644
|
// Skip events without processing
|
|
643
645
|
if (isPaused) {
|
|
@@ -648,7 +650,7 @@ if (isPaused) {
|
|
|
648
650
|
|
|
649
651
|
#### Event Lifetime
|
|
650
652
|
|
|
651
|
-
Events use double-buffered storage. Buffers rotate automatically at the end of each frame -- events survive one frame (so systems that run next frame can still read them), then are discarded. Calling `
|
|
653
|
+
Events use double-buffered storage. Buffers rotate automatically at the end of each frame -- events survive one frame (so systems that run next frame can still read them), then are discarded. Calling `readEvents()` marks events as read for that system -- a second call in the same system sees nothing new.
|
|
652
654
|
|
|
653
655
|
⚠️ **Events are not entities.** Unlike components and tags, events exist outside the entity-component model. You cannot query for events or attach them to entities.
|
|
654
656
|
|
|
@@ -658,27 +660,27 @@ Events use double-buffered storage. Buffers rotate automatically at the end of e
|
|
|
658
660
|
|
|
659
661
|
```typescript
|
|
660
662
|
import {
|
|
661
|
-
|
|
663
|
+
queryEntities,
|
|
662
664
|
added,
|
|
663
665
|
changed,
|
|
664
666
|
removed,
|
|
665
|
-
|
|
667
|
+
readEvents,
|
|
666
668
|
} from "iris-ecs";
|
|
667
669
|
|
|
668
670
|
// Entities where Position was added this tick
|
|
669
|
-
|
|
671
|
+
queryEntities(world, [added(Position)], (entity) => {
|
|
670
672
|
initializePhysicsBody(entity);
|
|
671
|
-
}
|
|
673
|
+
});
|
|
672
674
|
|
|
673
675
|
// Entities where Health was modified (added OR value changed)
|
|
674
|
-
|
|
676
|
+
queryEntities(world, [changed(Health)], (entity) => {
|
|
675
677
|
updateHealthBar(entity);
|
|
676
|
-
}
|
|
678
|
+
});
|
|
677
679
|
|
|
678
680
|
// Combine with regular filters
|
|
679
|
-
|
|
681
|
+
queryEntities(world, [Player, changed(Position), not(Dead)], (e) => {
|
|
680
682
|
updatePlayerOnMinimap(e);
|
|
681
|
-
}
|
|
683
|
+
});
|
|
682
684
|
```
|
|
683
685
|
|
|
684
686
|
Each system tracks changes independently -- if two systems query `added(Position)`, both see the same newly added entities.
|
|
@@ -689,9 +691,9 @@ Use `removed()` to detect when a component is removed from an entity. Unlike `ad
|
|
|
689
691
|
|
|
690
692
|
```typescript
|
|
691
693
|
// Iterate removal events (not a query filter)
|
|
692
|
-
|
|
694
|
+
readEvents(world, removed(Health), (event) => {
|
|
693
695
|
playDeathAnimation(event.entity);
|
|
694
|
-
}
|
|
696
|
+
});
|
|
695
697
|
```
|
|
696
698
|
|
|
697
699
|
#### Under the Hood
|
package/dist/component.js
CHANGED
|
@@ -150,8 +150,8 @@ export function hasComponent(world, entityId, componentId) {
|
|
|
150
150
|
* ```
|
|
151
151
|
*/
|
|
152
152
|
export function getComponentValue(world, entityId, componentId, fieldName) {
|
|
153
|
-
const
|
|
154
|
-
const fieldColumns =
|
|
153
|
+
const { archetype, row } = ensureEntity(world, entityId);
|
|
154
|
+
const fieldColumns = archetype.columns.get(componentId);
|
|
155
155
|
if (!fieldColumns) {
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
@@ -159,7 +159,7 @@ export function getComponentValue(world, entityId, componentId, fieldName) {
|
|
|
159
159
|
if (!column) {
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
return column[
|
|
162
|
+
return column[row];
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* Set component field value.
|
|
@@ -177,8 +177,8 @@ export function getComponentValue(world, entityId, componentId, fieldName) {
|
|
|
177
177
|
* ```
|
|
178
178
|
*/
|
|
179
179
|
export function setComponentValue(world, entityId, componentId, fieldName, value) {
|
|
180
|
-
const
|
|
181
|
-
const fieldColumns =
|
|
180
|
+
const { archetype, row } = ensureEntity(world, entityId);
|
|
181
|
+
const fieldColumns = archetype.columns.get(componentId);
|
|
182
182
|
if (!fieldColumns) {
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
@@ -186,10 +186,10 @@ export function setComponentValue(world, entityId, componentId, fieldName, value
|
|
|
186
186
|
if (!column) {
|
|
187
187
|
return;
|
|
188
188
|
}
|
|
189
|
-
column[
|
|
190
|
-
const ticks =
|
|
189
|
+
column[row] = value;
|
|
190
|
+
const ticks = archetype.ticks.get(componentId);
|
|
191
191
|
if (ticks) {
|
|
192
|
-
ticks.changed[
|
|
192
|
+
ticks.changed[row] = world.execution.tick;
|
|
193
193
|
}
|
|
194
194
|
fireObserverEvent(world, "componentChanged", componentId, entityId);
|
|
195
195
|
}
|
|
@@ -204,10 +204,10 @@ export function setComponentValue(world, entityId, componentId, fieldName, value
|
|
|
204
204
|
* emitComponentChanged(world, entity, Position); // Notify change tracking
|
|
205
205
|
*/
|
|
206
206
|
export function emitComponentChanged(world, entityId, componentId) {
|
|
207
|
-
const
|
|
208
|
-
const ticks =
|
|
207
|
+
const { archetype, row } = ensureEntity(world, entityId);
|
|
208
|
+
const ticks = archetype.ticks.get(componentId);
|
|
209
209
|
if (ticks) {
|
|
210
|
-
ticks.changed[
|
|
210
|
+
ticks.changed[row] = world.execution.tick;
|
|
211
211
|
}
|
|
212
212
|
fireObserverEvent(world, "componentChanged", componentId, entityId);
|
|
213
213
|
}
|
package/dist/component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEjG,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAqBnF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAY,EACZ,QAAkB,EAClB,WAAqB,EACrB,IAA2B;IAE3B,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAEjD,oCAAoC;IACpC,IAAI,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QACnD,OAAO;IACT,CAAC;IAED,6DAA6D;IAC7D,IAAI,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACjD,MAAM,QAAQ,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;QAE9C,IAAI,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;YACpE,MAAM,UAAU,GAAG,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAEjE,IA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C,QAAQ,CAAC,CAAC,CAAE,CAAC;YAExC,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;QAChD,CAAC;QAED,+DAA+D;QAC/D,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACrC,CAAC;AACH,CAAC"}
|
package/dist/entity.d.ts
CHANGED
|
@@ -35,7 +35,8 @@ export type EntityMeta = {
|
|
|
35
35
|
* @param world - World instance
|
|
36
36
|
* @param entityId - Entity or component ID
|
|
37
37
|
* @returns Entity metadata
|
|
38
|
-
* @throws {
|
|
38
|
+
* @throws {NotFound} If entity not registered (ENTITY_TYPE)
|
|
39
|
+
* @throws {InvalidState} If unknown entity type
|
|
39
40
|
*
|
|
40
41
|
* @example
|
|
41
42
|
* ```typescript
|
|
@@ -49,7 +50,7 @@ export declare function ensureEntity(world: World, entityId: EntityId): EntityMe
|
|
|
49
50
|
*
|
|
50
51
|
* @param world - World instance
|
|
51
52
|
* @returns Encoded entity ID
|
|
52
|
-
* @throws {
|
|
53
|
+
* @throws {LimitExceeded} If entity limit (1,048,576) exceeded
|
|
53
54
|
*
|
|
54
55
|
* @example
|
|
55
56
|
* ```typescript
|
package/dist/entity.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../src/entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,EAAa,MAAM,EAAE,QAAQ,EAAY,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../src/entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,EAAa,MAAM,EAAE,QAAQ,EAAY,MAAM,eAAe,CAAC;AAkB3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aA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ByRow, transferEntityToArchetypeByRow } from "./archetype.js";
|
|
2
2
|
import { addComponent, cascadeRemoveComponent } from "./component.js";
|
|
3
3
|
import { COMPONENT_TYPE, ENTITY_TYPE, encodeEntity, extractId, extractMeta, extractType, ID_MASK_8, ID_MASK_20, isPair, RELATIONSHIP_TYPE, TAG_TYPE, } from "./encoding.js";
|
|
4
|
+
import { assert, InvalidState, LimitExceeded, NotFound } from "./error.js";
|
|
4
5
|
import { fireObserverEvent } from "./observer.js";
|
|
5
6
|
import { Exclusive, OnDeleteTarget } from "./registry.js";
|
|
6
7
|
import { cleanupPairsTargetingEntity, getPairRelation } from "./relation.js";
|
|
@@ -16,9 +17,7 @@ function allocateEntityId(world) {
|
|
|
16
17
|
return encodeEntity(rawId, generation);
|
|
17
18
|
}
|
|
18
19
|
const newRawId = world.entities.nextId++;
|
|
19
|
-
|
|
20
|
-
throw new RangeError(`Entity ID limit exceeded: cannot allocate ID ${newRawId} (max ${ID_MASK_20})`);
|
|
21
|
-
}
|
|
20
|
+
assert(newRawId <= ID_MASK_20, LimitExceeded, { resource: "Entity", max: ID_MASK_20, id: newRawId });
|
|
22
21
|
world.entities.generations.set(newRawId, 0);
|
|
23
22
|
return encodeEntity(newRawId, 0);
|
|
24
23
|
}
|
|
@@ -44,7 +43,8 @@ function registerEntity(world, entityId, schema) {
|
|
|
44
43
|
* @param world - World instance
|
|
45
44
|
* @param entityId - Entity or component ID
|
|
46
45
|
* @returns Entity metadata
|
|
47
|
-
* @throws {
|
|
46
|
+
* @throws {NotFound} If entity not registered (ENTITY_TYPE)
|
|
47
|
+
* @throws {InvalidState} If unknown entity type
|
|
48
48
|
*
|
|
49
49
|
* @example
|
|
50
50
|
* ```typescript
|
|
@@ -85,10 +85,10 @@ export function ensureEntity(world, entityId) {
|
|
|
85
85
|
return meta;
|
|
86
86
|
}
|
|
87
87
|
case ENTITY_TYPE: {
|
|
88
|
-
throw new
|
|
88
|
+
throw new NotFound({ resource: "Entity", id: entityId, context: "world" });
|
|
89
89
|
}
|
|
90
90
|
default: {
|
|
91
|
-
throw new
|
|
91
|
+
throw new InvalidState({ message: `Invalid entity type: ${type}` });
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -97,7 +97,7 @@ export function ensureEntity(world, entityId) {
|
|
|
97
97
|
*
|
|
98
98
|
* @param world - World instance
|
|
99
99
|
* @returns Encoded entity ID
|
|
100
|
-
* @throws {
|
|
100
|
+
* @throws {LimitExceeded} If entity limit (1,048,576) exceeded
|
|
101
101
|
*
|
|
102
102
|
* @example
|
|
103
103
|
* ```typescript
|
package/dist/entity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../src/entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AACtH,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EACL,cAAc,EACd,WAAW,EACX,YAAY,EACZ,SAAS,EACT,WAAW,EACX,WAAW,EACX,SAAS,EACT,UAAU,EACV,MAAM,EACN,iBAAiB,EACjB,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAwC7E;;;GAGG;AACH,SAAS,gBAAgB,CAAC,KAAY;IACpC,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAC3C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,gDAAgD;QAChD,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAE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ACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,KAAY,EAAE,SAAoB;IAChE,4EAA4E;IAC5E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC;QACnC,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAY,EAAE,SAAoB;IACnE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC;QACnC,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;QAC9C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAE5C,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/error.d.ts
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base error class for all Iris ECS errors.
|
|
3
|
+
*
|
|
4
|
+
* Provides structured error categories with typed parameters for
|
|
5
|
+
* programmatic error handling via `instanceof` checks.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* try {
|
|
10
|
+
* createEntity(world);
|
|
11
|
+
* } catch (error) {
|
|
12
|
+
* if (error instanceof LimitExceeded) {
|
|
13
|
+
* console.log(error.resource, error.max);
|
|
14
|
+
* }
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class IrisError extends Error {
|
|
19
|
+
constructor(message: string, options?: {
|
|
20
|
+
cause?: unknown;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Thrown when an ID space is exhausted.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* // Thrown when entity limit (1,048,576) is exceeded
|
|
29
|
+
* const entity = createEntity(world);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class LimitExceeded extends IrisError {
|
|
33
|
+
readonly resource: string;
|
|
34
|
+
readonly max: number;
|
|
35
|
+
readonly id?: number;
|
|
36
|
+
constructor(params: {
|
|
37
|
+
resource: string;
|
|
38
|
+
max: number;
|
|
39
|
+
id?: number;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Thrown when a referenced item does not exist.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* // Thrown when accessing a destroyed entity
|
|
48
|
+
* ensureEntity(world, destroyedEntity);
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare class NotFound extends IrisError {
|
|
52
|
+
readonly resource: string;
|
|
53
|
+
readonly id: string | number;
|
|
54
|
+
readonly context?: string;
|
|
55
|
+
constructor(params: {
|
|
56
|
+
resource: string;
|
|
57
|
+
id: string | number;
|
|
58
|
+
context?: string;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Thrown when attempting to register a duplicate item.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* // Thrown when registering a system with the same name twice
|
|
67
|
+
* addSystem(world, mySystem);
|
|
68
|
+
* addSystem(world, mySystem); // throws Duplicate
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare class Duplicate extends IrisError {
|
|
72
|
+
readonly resource: string;
|
|
73
|
+
readonly id: string | number;
|
|
74
|
+
constructor(params: {
|
|
75
|
+
resource: string;
|
|
76
|
+
id: string | number;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Thrown when a function argument fails validation.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* // Thrown when registering an anonymous system without a name
|
|
85
|
+
* addSystem(world, () => {});
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare class InvalidArgument extends IrisError {
|
|
89
|
+
readonly expected: string;
|
|
90
|
+
readonly actual?: string;
|
|
91
|
+
constructor(params: {
|
|
92
|
+
expected: string;
|
|
93
|
+
actual?: string;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Thrown when the system reaches an invalid or unexpected state.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* // Thrown on circular system dependencies
|
|
102
|
+
* addSystem(world, a, { before: "b" });
|
|
103
|
+
* addSystem(world, b, { before: "a" });
|
|
104
|
+
* await runOnce(world);
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
export declare class InvalidState extends IrisError {
|
|
108
|
+
constructor(params: {
|
|
109
|
+
message: string;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Assert a condition, throwing a typed error if false.
|
|
114
|
+
*
|
|
115
|
+
* Error is only constructed when the condition fails (lazy construction).
|
|
116
|
+
* TypeScript `asserts condition` narrows the type at call sites.
|
|
117
|
+
*
|
|
118
|
+
* @param condition - Value to check for truthiness
|
|
119
|
+
* @param ErrorClass - Error class to instantiate on failure
|
|
120
|
+
* @param params - Constructor parameters for the error class
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* assert(rawId <= ID_MASK_20, LimitExceeded, { resource: "Entity", max: ID_MASK_20, id: rawId });
|
|
125
|
+
* // rawId is narrowed to truthy after this point
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
export declare function assert<P>(condition: unknown, ErrorClass: new (params: P) => IrisError, params: P): asserts condition;
|
|
129
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBACtB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAI3D;AAMD;;;;;;;;GAQG;AACH,qBAAa,aAAc,SAAQ,SAAS;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;gBAET,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE;CAOnE;AAED;;;;;;;;GAQG;AACH,qBAAa,QAAS,SAAQ,SAAS;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;gBAEd,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC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