Commit Graph

6 Commits

Author SHA1 Message Date
hypercross 24616a0855 perf(observable): index observers by component for faster dispatch
Introduce a component-to-observer index to avoid iterating over all
observers for every world event. This optimizes event dispatching by
only notifying observers whose queries are relevant to the specific
component being added, removed, or changed.
2026-05-31 16:10:51 +08:00
hypercross 1c55485f9f feat: add world serialization support
Introduce `toJSON` and `fromJSON` methods to the `World` class to
allow saving and restoring world states. This requires components and
relationships to have human-readable names for stable serialization.
2026-05-31 16:10:19 +08:00
hypercross d0bb119911 feat: implement relationship system 2026-05-31 15:54:29 +08:00
hypercross 32f8f29912 feat: add relationship support and observability
Introduces relationship management to the World, including
storage for forward and reverse relationships. Adds new observable
events and a `RelationshipUpdate` stream to track when relationships
are added or removed.
2026-05-31 15:54:21 +08:00
hypercross ba4a688f57 test: add vitest and implement unit tests 2026-05-31 15:47:19 +08:00
hypercross 4ede2d7f3b feat: implement core ECS engine with RxJS observability
Initial implementation of an Entity-Component-System (ECS) featuring:
- Sparse set-based component storage for efficient access.
- Entity lifecycle management with generation-based recycling.
- Reactive query system using RxJS for change tracking.
- Batched event flushing to support frame-based updates.
- Type-safe component definitions via TypeScript inference.
2026-05-31 15:45:20 +08:00