Go to file
cha0s 3aacc77ccd
Some checks failed
CI / build (push) Has been cancelled
CI / test (20.x) (push) Has been cancelled
CI / lint (push) Has been cancelled
release-please / release-please (push) Has been cancelled
feat: goold ol' escape hatch
2024-12-05 15:28:04 -06:00
.github/workflows chore: initial 2024-11-29 13:49:04 -06:00
src feat: goold ol' escape hatch 2024-12-05 15:28:04 -06:00
.eslintrc.cjs chore: initial 2024-11-29 13:49:04 -06:00
.gitignore chore: initial 2024-12-01 19:56:45 -06:00
.release-please-manifest.json chore: initial 2024-11-29 13:49:04 -06:00
benchmark.js chore: initial 2024-12-01 19:56:45 -06:00
CHANGELOG.md chore: initial 2024-11-29 13:49:04 -06:00
package-lock.json chore: bump crunches 2024-12-02 05:50:36 -06:00
package.json flow: many fixes and updates 2024-12-05 02:19:04 -06:00
README.md refactor: codecs 2024-12-02 02:09:33 -06:00
release-please-config.json chore: initial 2024-11-29 13:49:04 -06:00
vite.config.js refactor: codecs 2024-12-02 02:09:33 -06:00

CI

ecstc

This is a library.

ECS

Entities

Components

Systems

Queries

Serialization

ecstc works with crunches for binary serialization:

import {Codecs} from 'crunches';
import {Ecs, registerCodecs} from 'ecstc';

registerCodecs(Codecs);

const ecs = new Ecs({Components: {}, Systems: {}});
ecs.create(); // now has entity ID: 1 with no components

const schema = new Schema({ecs, type: 'ecstc-ecs'});
const view = schema.allocate(ecs.entities);
schema.encode(ecs.entities, view);
console.log(schema.decode(view)) // Map(1) { 1 => {} }
// or,
schema.encode(ecs.diff(), view);
console.log(schema.decode(view)) // Map(1) { 1 => {} }