@oasys/oecs 0.1.0
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/LICENSE +21 -0
- package/README.md +305 -0
- package/dist/archetype.d.ts +61 -0
- package/dist/archetype.d.ts.map +1 -0
- package/dist/component.d.ts +18 -0
- package/dist/component.d.ts.map +1 -0
- package/dist/entity.d.ts +11 -0
- package/dist/entity.d.ts.map +1 -0
- package/dist/event.d.ts +24 -0
- package/dist/event.d.ts.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1182 -0
- package/dist/query.d.ts +73 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/schedule.d.ts +40 -0
- package/dist/schedule.d.ts.map +1 -0
- package/dist/store.d.ts +92 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/system.d.ts +16 -0
- package/dist/system.d.ts.map +1 -0
- package/dist/type_primitives/assertions.d.ts +14 -0
- package/dist/type_primitives/assertions.d.ts.map +1 -0
- package/dist/type_primitives/bitset/bitset.d.ts +37 -0
- package/dist/type_primitives/bitset/bitset.d.ts.map +1 -0
- package/dist/type_primitives/brand.d.ts +18 -0
- package/dist/type_primitives/brand.d.ts.map +1 -0
- package/dist/type_primitives/error.d.ts +10 -0
- package/dist/type_primitives/error.d.ts.map +1 -0
- package/dist/type_primitives/index.d.ts +8 -0
- package/dist/type_primitives/index.d.ts.map +1 -0
- package/dist/type_primitives/sparse_map/sparse_map.d.ts +26 -0
- package/dist/type_primitives/sparse_map/sparse_map.d.ts.map +1 -0
- package/dist/type_primitives/sparse_set/sparse_set.d.ts +24 -0
- package/dist/type_primitives/sparse_set/sparse_set.d.ts.map +1 -0
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts +79 -0
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts.map +1 -0
- package/dist/utils/arrays.d.ts +6 -0
- package/dist/utils/arrays.d.ts.map +1 -0
- package/dist/utils/error.d.ts +28 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/world.d.ts +63 -0
- package/dist/world.d.ts.map +1 -0
- package/package.json +53 -0
package/dist/query.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Store } from './store';
|
|
2
|
+
import { Archetype } from './archetype';
|
|
3
|
+
import { EntityID } from './entity';
|
|
4
|
+
import { ComponentDef, ComponentFields, FieldValues, ColumnsForSchema } from './component';
|
|
5
|
+
import { EventDef, EventReader } from './event';
|
|
6
|
+
import { BitSet } from './type_primitives';
|
|
7
|
+
type DefsToColumns<Defs extends readonly ComponentDef<ComponentFields>[]> = {
|
|
8
|
+
[K in keyof Defs]: ColumnsForSchema<Defs[K] extends ComponentDef<infer F> ? F : never>;
|
|
9
|
+
};
|
|
10
|
+
type EachFn<Defs extends readonly ComponentDef<ComponentFields>[]> = (...args: [...DefsToColumns<Defs>, number]) => void;
|
|
11
|
+
export interface QueryCacheEntry {
|
|
12
|
+
include_mask: BitSet;
|
|
13
|
+
exclude_mask: BitSet | null;
|
|
14
|
+
any_of_mask: BitSet | null;
|
|
15
|
+
query: Query<any>;
|
|
16
|
+
}
|
|
17
|
+
export interface QueryResolver {
|
|
18
|
+
_resolve_query(include: BitSet, exclude: BitSet | null, any_of: BitSet | null, defs: readonly ComponentDef<ComponentFields>[]): Query<any>;
|
|
19
|
+
}
|
|
20
|
+
export declare class Query<Defs extends readonly ComponentDef<ComponentFields>[]> {
|
|
21
|
+
private readonly _archetypes;
|
|
22
|
+
private readonly _defs;
|
|
23
|
+
readonly _resolver: QueryResolver;
|
|
24
|
+
readonly _include: BitSet;
|
|
25
|
+
readonly _exclude: BitSet | null;
|
|
26
|
+
readonly _any_of: BitSet | null;
|
|
27
|
+
private readonly _args_buf;
|
|
28
|
+
constructor(archetypes: Archetype[], defs: Defs, resolver: QueryResolver, include: BitSet, exclude: BitSet | null, any_of: BitSet | null);
|
|
29
|
+
/** Number of matching archetypes (including empty ones). */
|
|
30
|
+
get length(): number;
|
|
31
|
+
/** Total entity count across all matching archetypes. */
|
|
32
|
+
count(): number;
|
|
33
|
+
get archetypes(): readonly Archetype[];
|
|
34
|
+
/** Iterate non-empty archetypes. Skips archetypes with zero entities. */
|
|
35
|
+
[Symbol.iterator](): Iterator<Archetype>;
|
|
36
|
+
/**
|
|
37
|
+
* Typed per-archetype iteration. Calls fn once per non-empty archetype
|
|
38
|
+
* with column groups for each queried component, plus the entity count.
|
|
39
|
+
* The system is responsible for the inner loop over entities.
|
|
40
|
+
*/
|
|
41
|
+
each(fn: EachFn<Defs>): void;
|
|
42
|
+
/** Extend required component set. Returns a new (cached) Query. */
|
|
43
|
+
and<D extends ComponentDef<ComponentFields>[]>(...comps: D): Query<[...Defs, ...D]>;
|
|
44
|
+
/** Exclude archetypes that have any of these components. */
|
|
45
|
+
not(...comps: ComponentDef<ComponentFields>[]): Query<Defs>;
|
|
46
|
+
/** Require at least one of these components. */
|
|
47
|
+
or(...comps: ComponentDef<ComponentFields>[]): Query<Defs>;
|
|
48
|
+
}
|
|
49
|
+
export declare class QueryBuilder {
|
|
50
|
+
private readonly _resolver;
|
|
51
|
+
constructor(_resolver: QueryResolver);
|
|
52
|
+
every<T extends ComponentDef<ComponentFields>[]>(...defs: T): Query<T>;
|
|
53
|
+
}
|
|
54
|
+
export declare class SystemContext {
|
|
55
|
+
private readonly store;
|
|
56
|
+
constructor(store: Store);
|
|
57
|
+
create_entity(): EntityID;
|
|
58
|
+
get_field<F extends ComponentFields>(def: ComponentDef<F>, entity_id: EntityID, field: F[number]): number;
|
|
59
|
+
set_field<F extends ComponentFields>(def: ComponentDef<F>, entity_id: EntityID, field: F[number], value: number): void;
|
|
60
|
+
/** Buffer an entity for deferred destruction (applied at phase flush). */
|
|
61
|
+
destroy_entity(id: EntityID): this;
|
|
62
|
+
flush_destroyed(): void;
|
|
63
|
+
add_component(entity_id: EntityID, def: ComponentDef<readonly []>): this;
|
|
64
|
+
add_component<F extends ComponentFields>(entity_id: EntityID, def: ComponentDef<F>, values: FieldValues<F>): this;
|
|
65
|
+
remove_component(entity_id: EntityID, def: ComponentDef<ComponentFields>): this;
|
|
66
|
+
/** Flush all deferred changes: structural (add/remove) first, then destructions. */
|
|
67
|
+
flush(): void;
|
|
68
|
+
emit(def: EventDef<readonly []>): void;
|
|
69
|
+
emit<F extends ComponentFields>(def: EventDef<F>, values: FieldValues<F>): void;
|
|
70
|
+
read<F extends ComponentFields>(def: EventDef<F>): EventReader<F>;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BK;AAEL,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EACV,YAAY,EAEZ,eAAe,EACf,WAAW,EACX,gBAAgB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAOzC,KAAK,aAAa,CAAC,IAAI,SAAS,SAAS,YAAY,CAAC,eAAe,CAAC,EAAE,IAAI;KACzE,CAAC,IAAI,MAAM,IAAI,GAAG,gBAAgB,CACjC,IAAI,CAAC,CAAC,CAAC,SAAS,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAClD;CACF,CAAC;AAIF,KAAK,MAAM,CAAC,IAAI,SAAS,SAAS,YAAY,CAAC,eAAe,CAAC,EAAE,IAAI,CACnE,GAAG,IAAI,EAAE,C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C1E,cAAc,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI;IAKlC,eAAe,IAAI,IAAI;IAIvB,aAAa,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,YAAY,CAAC,SAAS,EAAE,CAAC,GAAG,IAAI;IACxE,aAAa,CAAC,CAAC,SAAS,eAAe,EACrC,SAAS,EAAE,QAAQ,EACnB,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC,EACpB,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GACrB,IAAI;IAUP,gBAAgB,CACd,SAAS,EAAE,QAAQ,EACnB,GAAG,EAAE,YAAY,CAAC,eAAe,CAAC,GACjC,IAAI;IAKP,oFAAoF;IACpF,KAAK,IAAI,IAAI;IASb,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC,GAAG,IAAI;IACtC,IAAI,CAAC,CAAC,SAAS,eAAe,EAC5B,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,EAChB,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GACrB,IAAI;IAYP,IAAI,CAAC,CAAC,SAAS,eAAe,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;CAGlE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { SystemContext } from './query';
|
|
2
|
+
import { SystemDescriptor } from './system';
|
|
3
|
+
export declare enum SCHEDULE {
|
|
4
|
+
PRE_STARTUP = "PRE_STARTUP",
|
|
5
|
+
STARTUP = "STARTUP",
|
|
6
|
+
POST_STARTUP = "POST_STARTUP",
|
|
7
|
+
PRE_UPDATE = "PRE_UPDATE",
|
|
8
|
+
UPDATE = "UPDATE",
|
|
9
|
+
POST_UPDATE = "POST_UPDATE"
|
|
10
|
+
}
|
|
11
|
+
export interface SystemOrdering {
|
|
12
|
+
before?: SystemDescriptor[];
|
|
13
|
+
after?: SystemDescriptor[];
|
|
14
|
+
}
|
|
15
|
+
export interface SystemEntry {
|
|
16
|
+
system: SystemDescriptor;
|
|
17
|
+
ordering?: SystemOrdering;
|
|
18
|
+
}
|
|
19
|
+
export declare class Schedule {
|
|
20
|
+
private label_systems;
|
|
21
|
+
private sorted_cache;
|
|
22
|
+
private system_index;
|
|
23
|
+
private next_insertion_order;
|
|
24
|
+
constructor();
|
|
25
|
+
add_systems(label: SCHEDULE, ...entries: (SystemDescriptor | SystemEntry)[]): void;
|
|
26
|
+
remove_system(system: SystemDescriptor): void;
|
|
27
|
+
run_startup(ctx: SystemContext): void;
|
|
28
|
+
run_update(ctx: SystemContext, delta_time: number): void;
|
|
29
|
+
get_all_systems(): SystemDescriptor[];
|
|
30
|
+
has_system(system: SystemDescriptor): boolean;
|
|
31
|
+
clear(): void;
|
|
32
|
+
private run_label;
|
|
33
|
+
private get_sorted;
|
|
34
|
+
/**
|
|
35
|
+
* Kahn's algorithm: BFS-based topological sort.
|
|
36
|
+
* Uses insertion_order as a stable tiebreaker (lower insertion order runs first).
|
|
37
|
+
*/
|
|
38
|
+
private topological_sort;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=schedule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../src/schedule.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;KAwBK;AAEL,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjD,oBAAY,QAAQ;IAClB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,WAAW,gBAAgB;CAC5B;AAcD,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AASD,qBAAa,QAAQ;IACnB,OAAO,CAAC,aAAa,CAA0C;IAC/D,OAAO,CAAC,YAAY,CAAgD;IACpE,OAAO,CAAC,YAAY,CAA8C;IAClE,OAAO,CAAC,oBAAoB,CAAK;;IAWjC,WAAW,CACT,KAAK,EAAE,QAAQ,EACf,GAAG,OAAO,EAAE,CAAC,gBAAgB,GAAG,WAAW,CAAC,EAAE,GAC7C,IAAI;IA2BP,aAAa,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAyB7C,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI;IAMrC,UAAU,CAAC,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAMxD,eAAe,IAAI,gBAAgB,EAAE;IAUrC,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO;IAI7C,KAAK,IAAI,IAAI;IAQb,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,UAAU;IAUlB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;CAsEzB"}
|
package/dist/store.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { EntityID } from './entity';
|
|
2
|
+
import { ComponentDef, ComponentFields, FieldValues } from './component';
|
|
3
|
+
import { EventDef, EventReader } from './event';
|
|
4
|
+
import { BitSet } from './type_primitives';
|
|
5
|
+
import { Archetype } from './archetype';
|
|
6
|
+
export declare class Store {
|
|
7
|
+
private entity_generations;
|
|
8
|
+
private entity_high_water;
|
|
9
|
+
private entity_free_indices;
|
|
10
|
+
private entity_alive_count;
|
|
11
|
+
private component_metas;
|
|
12
|
+
private component_count;
|
|
13
|
+
private event_channels;
|
|
14
|
+
private event_count;
|
|
15
|
+
private archetypes;
|
|
16
|
+
private archetype_map;
|
|
17
|
+
private next_archetype_id;
|
|
18
|
+
private component_index;
|
|
19
|
+
private registered_queries;
|
|
20
|
+
private empty_archetype_id;
|
|
21
|
+
private entity_archetype;
|
|
22
|
+
private entity_row;
|
|
23
|
+
private pending_destroy;
|
|
24
|
+
private pending_add_ids;
|
|
25
|
+
private pending_add_defs;
|
|
26
|
+
private pending_add_values;
|
|
27
|
+
private pending_remove_ids;
|
|
28
|
+
private pending_remove_defs;
|
|
29
|
+
constructor();
|
|
30
|
+
private arch_get;
|
|
31
|
+
/**
|
|
32
|
+
* Find or create an archetype for the given component mask.
|
|
33
|
+
* Also updates the component_index and pushes into matching registered queries.
|
|
34
|
+
*/
|
|
35
|
+
private arch_get_or_create_from_mask;
|
|
36
|
+
/** Resolve "add component_id to archetype_id" → target ArchetypeID. Caches the edge. */
|
|
37
|
+
private arch_resolve_add;
|
|
38
|
+
/** Resolve "remove component_id from archetype_id" → target ArchetypeID. Caches the edge. */
|
|
39
|
+
private arch_resolve_remove;
|
|
40
|
+
/** Cache a bidirectional add/remove edge between two archetypes. */
|
|
41
|
+
private arch_cache_edge;
|
|
42
|
+
create_entity(): EntityID;
|
|
43
|
+
/** Immediately destroy an entity, removing it from its archetype. */
|
|
44
|
+
destroy_entity(id: EntityID): void;
|
|
45
|
+
is_alive(id: EntityID): boolean;
|
|
46
|
+
get entity_count(): number;
|
|
47
|
+
destroy_entity_deferred(id: EntityID): void;
|
|
48
|
+
/** Flush all buffered entity destructions in batch. */
|
|
49
|
+
flush_destroyed(): void;
|
|
50
|
+
get pending_destroy_count(): number;
|
|
51
|
+
add_component_deferred(entity_id: EntityID, def: ComponentDef<readonly []>): void;
|
|
52
|
+
add_component_deferred<F extends ComponentFields>(entity_id: EntityID, def: ComponentDef<F>, values: FieldValues<F>): void;
|
|
53
|
+
remove_component_deferred(entity_id: EntityID, def: ComponentDef<ComponentFields>): void;
|
|
54
|
+
flush_structural(): void;
|
|
55
|
+
/** Batch-apply all deferred component additions. */
|
|
56
|
+
private _flush_adds;
|
|
57
|
+
/** Batch-apply all deferred component removals. */
|
|
58
|
+
private _flush_removes;
|
|
59
|
+
get pending_structural_count(): number;
|
|
60
|
+
register_component<F extends readonly string[]>(fields: F): ComponentDef<F>;
|
|
61
|
+
add_component(entity_id: EntityID, def: ComponentDef<readonly []>): void;
|
|
62
|
+
add_component<F extends ComponentFields>(entity_id: EntityID, def: ComponentDef<F>, values: FieldValues<F>): void;
|
|
63
|
+
/** Add multiple components in one transition (resolves final archetype, then moves once). */
|
|
64
|
+
add_components(entity_id: EntityID, entries: {
|
|
65
|
+
def: ComponentDef<ComponentFields>;
|
|
66
|
+
values?: Record<string, number>;
|
|
67
|
+
}[]): void;
|
|
68
|
+
remove_component(entity_id: EntityID, def: ComponentDef<ComponentFields>): void;
|
|
69
|
+
/** Remove multiple components in one transition (resolves final archetype, then moves once). */
|
|
70
|
+
remove_components(entity_id: EntityID, defs: ComponentDef<ComponentFields>[]): void;
|
|
71
|
+
has_component(entity_id: EntityID, def: ComponentDef<ComponentFields>): boolean;
|
|
72
|
+
get_entity_archetype(entity_id: EntityID): Archetype;
|
|
73
|
+
get_entity_row(entity_id: EntityID): number;
|
|
74
|
+
/**
|
|
75
|
+
* Find all archetypes matching the given masks.
|
|
76
|
+
* Uses the inverted component_index to start from the component with the
|
|
77
|
+
* fewest archetypes, minimizing the number of superset checks.
|
|
78
|
+
*/
|
|
79
|
+
get_matching_archetypes(required: BitSet, excluded?: BitSet, any_of?: BitSet): readonly Archetype[];
|
|
80
|
+
/**
|
|
81
|
+
* Register a live query. Returns a mutable Archetype[] that this Store will
|
|
82
|
+
* push newly-created matching archetypes into, keeping the query always up-to-date.
|
|
83
|
+
*/
|
|
84
|
+
register_query(include: BitSet, exclude?: BitSet, any_of?: BitSet): Archetype[];
|
|
85
|
+
get archetype_count(): number;
|
|
86
|
+
register_event<F extends readonly string[]>(fields: F): EventDef<F>;
|
|
87
|
+
emit_event<F extends ComponentFields>(def: EventDef<F>, values: Record<string, number>): void;
|
|
88
|
+
emit_signal(def: EventDef<readonly []>): void;
|
|
89
|
+
get_event_reader<F extends ComponentFields>(def: EventDef<F>): EventReader<F>;
|
|
90
|
+
clear_events(): void;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;KAuBK;AAEL,OAAO,EAOL,KAAK,QAAQ,EACd,MAAM,UAAU,CAAC;AAClB,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,WAAW,EACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAe,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACL,SAAS,EAIV,MAAM,aAAa,CAAC;AAYrB,qBAAa,KAAK;IAIhB,OAAO,CAAC,kBAAkB,CAAgB;IAC1C,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,mBAAmB,CAAgB;IAC3C,OAAO,CAAC,kBAAkB,CAAK;IAK/B,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,eAAe,CAAK;IAI5B,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,WAAW,CAAK;IAGxB,OAAO,CAAC,UAAU,CAAmB;IAErC,OAAO,CAAC,aAAa,CAAyC;IAC9D,OAAO,CAAC,iBAAiB,CAAK;IAG9B,OAAO,CAAC,eAAe,CAAiD;IAGxE,OAAO,CAAC,kBAAkB,CAKjB;IACT,OAAO,CAAC,kBAAkB,CAAc;IAGxC,OAAO,CAAC,gBAAgB,CAAgB;IAExC,OAAO,CAAC,UAAU,CAAgB;IAKlC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,gBAAgB,CAAuC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AAE,CAAC,GACR,QAAQ,CAAC,CAAC,CAAC;IAOP,UAAU,CAAC,CAAC,SAAS,eAAe,EACzC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,IAAI;IAIA,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC,GAAG,IAAI;IAI7C,gBAAgB,CAAC,CAAC,SAAS,eAAe,EAC/C,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,GACf,WAAW,CAAC,CAAC,CAAC;IAIV,YAAY,IAAI,IAAI;CAM5B"}
|
package/dist/system.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Brand } from './type_primitives';
|
|
2
|
+
import { SystemContext } from './query';
|
|
3
|
+
import { Store } from './store';
|
|
4
|
+
export type SystemID = Brand<number, "system_id">;
|
|
5
|
+
export declare const as_system_id: (value: number) => SystemID;
|
|
6
|
+
export type SystemFn = (ctx: SystemContext, delta_time: number) => void;
|
|
7
|
+
export interface SystemConfig {
|
|
8
|
+
fn: SystemFn;
|
|
9
|
+
on_added?: (store: Store) => void;
|
|
10
|
+
on_removed?: () => void;
|
|
11
|
+
dispose?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export interface SystemDescriptor extends Readonly<SystemConfig> {
|
|
14
|
+
readonly id: SystemID;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../src/system.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;KAcK;AAEL,OAAO,EACL,KAAK,EAGN,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAElD,eAAO,MAAM,YAAY,UAAW,MAAM,aAKvC,CAAC;AAEJ,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;AAExE,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,QAAQ,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,gBAAiB,SAAQ,QAAQ,CAAC,YAAY,CAAC;IAC9D,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;CACvB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* Assertions — Dev-only runtime validation and branded casting.
|
|
3
|
+
*
|
|
4
|
+
* All checks are guarded by __DEV__ and tree-shaken in production builds.
|
|
5
|
+
* validate_and_cast is the primary tool for creating branded IDs:
|
|
6
|
+
* it validates the input in dev and returns the value as the branded type.
|
|
7
|
+
* unsafe_cast bypasses all checks (used when the caller guarantees validity).
|
|
8
|
+
*
|
|
9
|
+
***/
|
|
10
|
+
export declare const is_non_negative_integer: (v: number) => boolean;
|
|
11
|
+
export declare function assert<T, Result extends T = T>(value: T, condition: (v: T) => v is Result, err_message: string): asserts value is Result;
|
|
12
|
+
export declare function validate_and_cast<T, Result extends T = T>(value: T, validator: (v: T) => boolean, err_message: string): Result;
|
|
13
|
+
export declare function unsafe_cast<T>(value: unknown): T;
|
|
14
|
+
//# sourceMappingURL=assertions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../../src/type_primitives/assertions.ts"],"names":[],"mappings":"AAAA;;;;;;;;KAQK;AAIL,eAAO,MAAM,uBAAuB,MAAO,MAAM,KAAG,OACrB,CAAC;AAEhC,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,SAAS,CAAC,GAAG,CAAC,EAC5C,KAAK,EAAE,CAAC,EACR,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,MAAM,EAChC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,KAAK,IAAI,MAAM,CAOzB;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,SAAS,CAAC,GAAG,CAAC,EACvD,KAAK,EAAE,CAAC,EACR,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,EAC5B,WAAW,EAAE,MAAM,GAClB,MAAM,CAQR;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,CAEhD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* BitSet — number[]-backed bit set with auto-grow.
|
|
3
|
+
*
|
|
4
|
+
* Used as the archetype component signature. Each bit position corresponds
|
|
5
|
+
* to a ComponentID. Operations (has/set/clear) are O(1), and mask
|
|
6
|
+
* comparisons (contains, equals, overlaps) are O(words) where
|
|
7
|
+
* words = ceil(maxComponentId / 32).
|
|
8
|
+
*
|
|
9
|
+
* Bit layout within each 32-bit word:
|
|
10
|
+
* word_index = bit >>> 5 (divide by 32)
|
|
11
|
+
* bit_offset = bit & 31 (mod 32)
|
|
12
|
+
* test: word & (1 << offset)
|
|
13
|
+
* set: word |= (1 << offset)
|
|
14
|
+
* clear: word &= ~(1 << offset)
|
|
15
|
+
*
|
|
16
|
+
***/
|
|
17
|
+
export declare class BitSet {
|
|
18
|
+
_words: number[];
|
|
19
|
+
constructor(words?: number[]);
|
|
20
|
+
has(bit: number): boolean;
|
|
21
|
+
set(bit: number): void;
|
|
22
|
+
clear(bit: number): void;
|
|
23
|
+
/** True if any bit is set in both this and other (non-empty intersection). */
|
|
24
|
+
overlaps(other: BitSet): boolean;
|
|
25
|
+
/** True if this is a superset of other (all bits in other are set in this). */
|
|
26
|
+
contains(other: BitSet): boolean;
|
|
27
|
+
equals(other: BitSet): boolean;
|
|
28
|
+
copy(): BitSet;
|
|
29
|
+
copy_with_set(bit: number): BitSet;
|
|
30
|
+
copy_with_clear(bit: number): BitSet;
|
|
31
|
+
/** FNV-1a hash. Skips trailing zero words so differently-sized arrays with the same bits hash equally. */
|
|
32
|
+
hash(): number;
|
|
33
|
+
/** Iterate all set bits via lowest-set-bit extraction. */
|
|
34
|
+
for_each(fn: (bit: number) => void): void;
|
|
35
|
+
private grow;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=bitset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitset.d.ts","sourceRoot":"","sources":["../../../src/type_primitives/bitset/bitset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;KAeK;AAIL,qBAAa,MAAM;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;gBAEL,KAAK,CAAC,EAAE,MAAM,EAAE;IAI5B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAMzB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAMtB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAMxB,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAUhC,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAehC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAa9B,IAAI,IAAI,MAAM;IAId,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAUlC,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IASpC,0GAA0G;IAC1G,IAAI,IAAI,MAAM;IAad,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAmBzC,OAAO,CAAC,IAAI;CAOb"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* Brand — Nominal typing for TypeScript.
|
|
3
|
+
*
|
|
4
|
+
* Brand<T, Name> intersects T with a phantom readonly symbol property
|
|
5
|
+
* tagged with Name. The symbol never exists at runtime — it only prevents
|
|
6
|
+
* accidental assignment between structurally identical types.
|
|
7
|
+
*
|
|
8
|
+
* Example: EntityID and ComponentID are both numbers at runtime, but
|
|
9
|
+
* Brand<number, "entity_id"> and Brand<number, "component_id"> are
|
|
10
|
+
* incompatible at compile time.
|
|
11
|
+
*
|
|
12
|
+
***/
|
|
13
|
+
declare const brand: unique symbol;
|
|
14
|
+
export type Brand<T, BrandName extends string> = T & {
|
|
15
|
+
readonly [brand]: BrandName;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=brand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../../src/type_primitives/brand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;KAWK;AAEL,OAAO,CAAC,MAAM,KAAK,EAAE,OAAO,MAAM,CAAC;AAEnC,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,SAAS,SAAS,MAAM,IAAI,CAAC,GAAG;IACnD,QAAQ,CAAC,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;CAC7B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppError } from '../utils/error';
|
|
2
|
+
export declare enum TYPE_ERROR {
|
|
3
|
+
ASSERTION_FAIL_CONDITION = "ASSERTION_FAIL_CONDITION",
|
|
4
|
+
VALIDATION_FAIL_CONDITION = "VALIDATION_FAIL_CONDITION"
|
|
5
|
+
}
|
|
6
|
+
export declare class TypeError extends AppError {
|
|
7
|
+
readonly category: TYPE_ERROR;
|
|
8
|
+
constructor(category: TYPE_ERROR, message: string, context?: Record<string, unknown>);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/type_primitives/error.ts"],"names":[],"mappings":"AAAA;;;;;;KAMK;AAEL,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,oBAAY,UAAU;IACpB,wBAAwB,6BAA6B;IACrD,yBAAyB,8BAA8B;CACxD;AAED,qBAAa,SAAU,SAAQ,QAAQ;aAEnB,QAAQ,EAAE,UAAU;gBAApB,QAAQ,EAAE,UAAU,EACpC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAIpC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './assertions';
|
|
2
|
+
export * from './brand';
|
|
3
|
+
export * from './error';
|
|
4
|
+
export * from './bitset/bitset';
|
|
5
|
+
export * from './sparse_set/sparse_set';
|
|
6
|
+
export * from './sparse_map/sparse_map';
|
|
7
|
+
export * from './typed_arrays/typed_arrays';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/type_primitives/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* SparseMap — O(1) integer-keyed map with cache-friendly dense iteration.
|
|
3
|
+
*
|
|
4
|
+
* Keys are non-negative integers. Two parallel dense arrays (keys + values)
|
|
5
|
+
* enable linear iteration. A sparse number[] maps key → dense index for
|
|
6
|
+
* O(1) get/set/delete.
|
|
7
|
+
*
|
|
8
|
+
* Membership is verified by cross-referencing dense_keys[sparse[key]] === key,
|
|
9
|
+
* so stale sparse entries are harmless. Deletion uses swap-and-pop.
|
|
10
|
+
*
|
|
11
|
+
***/
|
|
12
|
+
export declare class SparseMap<V> {
|
|
13
|
+
private _dense_keys;
|
|
14
|
+
private _dense_vals;
|
|
15
|
+
private _sparse;
|
|
16
|
+
get size(): number;
|
|
17
|
+
get keys(): readonly number[];
|
|
18
|
+
has(key: number): boolean;
|
|
19
|
+
get(key: number): V | undefined;
|
|
20
|
+
set(key: number, value: V): void;
|
|
21
|
+
delete(key: number): boolean;
|
|
22
|
+
clear(): void;
|
|
23
|
+
for_each(fn: (key: number, value: V) => void): void;
|
|
24
|
+
[Symbol.iterator](): Iterator<[number, V]>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=sparse_map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sparse_map.d.ts","sourceRoot":"","sources":["../../../src/type_primitives/sparse_map/sparse_map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;KAUK;AAEL,qBAAa,SAAS,CAAC,CAAC;IACtB,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,WAAW,CAAW;IAC9B,OAAO,CAAC,OAAO,CAAgB;IAE/B,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,IAAI,IAAI,SAAS,MAAM,EAAE,CAE5B;IAED,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAI/B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAUhC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAa5B,KAAK,IAAI,IAAI;IAMb,QAAQ,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,IAAI;IAMnD,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CAa3C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* SparseSet — O(1) integer-key set with cache-friendly dense iteration.
|
|
3
|
+
*
|
|
4
|
+
* Keys are non-negative integers. A dense number[] holds members packed
|
|
5
|
+
* at 0..size-1 for linear iteration. A sparse number[] maps
|
|
6
|
+
* key → dense index for O(1) has/add/delete.
|
|
7
|
+
*
|
|
8
|
+
* Membership is verified by cross-referencing dense[sparse[key]] === key,
|
|
9
|
+
* so stale sparse entries are harmless (no clearing needed on delete).
|
|
10
|
+
* Deletion uses swap-and-pop to keep data contiguous.
|
|
11
|
+
*
|
|
12
|
+
***/
|
|
13
|
+
export declare class SparseSet {
|
|
14
|
+
private _dense;
|
|
15
|
+
private _sparse;
|
|
16
|
+
get size(): number;
|
|
17
|
+
get values(): readonly number[];
|
|
18
|
+
has(key: number): boolean;
|
|
19
|
+
add(key: number): void;
|
|
20
|
+
delete(key: number): boolean;
|
|
21
|
+
clear(): void;
|
|
22
|
+
[Symbol.iterator](): Iterator<number>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=sparse_set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sparse_set.d.ts","sourceRoot":"","sources":["../../../src/type_primitives/sparse_set/sparse_set.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;KAWK;AAEL,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,OAAO,CAAgB;IAE/B,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,MAAM,IAAI,SAAS,MAAM,EAAE,CAE9B;IAED,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAMtB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAW5B,KAAK,IAAI,IAAI;IAKb,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC;CAGtC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* GrowableTypedArray — TypedArray wrapper with amortised O(1) append.
|
|
3
|
+
*
|
|
4
|
+
* TypedArrays have fixed length — resizing requires allocating a new
|
|
5
|
+
* buffer and copying. GrowableTypedArray wraps one with a separate
|
|
6
|
+
* logical length and doubles the backing buffer on overflow.
|
|
7
|
+
*
|
|
8
|
+
* Named subclasses (GrowableFloat32Array etc.) are provided for each
|
|
9
|
+
* numeric type. TypedArrayFor maps TypeTag strings to their class so
|
|
10
|
+
* component columns can be allocated by tag.
|
|
11
|
+
*
|
|
12
|
+
***/
|
|
13
|
+
export type TypedArrayTag = "f32" | "f64" | "i8" | "i16" | "i32" | "u8" | "u16" | "u32";
|
|
14
|
+
export type AnyTypedArray = Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array;
|
|
15
|
+
export declare class GrowableTypedArray<T extends AnyTypedArray> {
|
|
16
|
+
private readonly _ctor;
|
|
17
|
+
private _buf;
|
|
18
|
+
private _len;
|
|
19
|
+
constructor(_ctor: new (n: number) => T, initial_capacity?: number);
|
|
20
|
+
get length(): number;
|
|
21
|
+
push(value: number): void;
|
|
22
|
+
pop(): number;
|
|
23
|
+
get(i: number): number;
|
|
24
|
+
set_at(i: number, value: number): void;
|
|
25
|
+
/**
|
|
26
|
+
* Move the last element into slot i, decrement length.
|
|
27
|
+
* Returns the value that was removed from slot i.
|
|
28
|
+
*/
|
|
29
|
+
swap_remove(i: number): number;
|
|
30
|
+
clear(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Raw backing buffer. Valid data: indices 0..length-1.
|
|
33
|
+
* This reference is stable until the next push() that triggers a grow —
|
|
34
|
+
* do not cache across entity additions.
|
|
35
|
+
*/
|
|
36
|
+
get buf(): T;
|
|
37
|
+
/**
|
|
38
|
+
* Zero-copy subarray view of valid data (0..length-1).
|
|
39
|
+
* Shares the backing buffer — invalidated if a subsequent push() grows.
|
|
40
|
+
*/
|
|
41
|
+
view(): T;
|
|
42
|
+
[Symbol.iterator](): Iterator<number>;
|
|
43
|
+
private _grow;
|
|
44
|
+
}
|
|
45
|
+
export declare class GrowableFloat32Array extends GrowableTypedArray<Float32Array> {
|
|
46
|
+
constructor(initial_capacity?: number);
|
|
47
|
+
}
|
|
48
|
+
export declare class GrowableFloat64Array extends GrowableTypedArray<Float64Array> {
|
|
49
|
+
constructor(initial_capacity?: number);
|
|
50
|
+
}
|
|
51
|
+
export declare class GrowableInt8Array extends GrowableTypedArray<Int8Array> {
|
|
52
|
+
constructor(initial_capacity?: number);
|
|
53
|
+
}
|
|
54
|
+
export declare class GrowableInt16Array extends GrowableTypedArray<Int16Array> {
|
|
55
|
+
constructor(initial_capacity?: number);
|
|
56
|
+
}
|
|
57
|
+
export declare class GrowableInt32Array extends GrowableTypedArray<Int32Array> {
|
|
58
|
+
constructor(initial_capacity?: number);
|
|
59
|
+
}
|
|
60
|
+
export declare class GrowableUint8Array extends GrowableTypedArray<Uint8Array> {
|
|
61
|
+
constructor(initial_capacity?: number);
|
|
62
|
+
}
|
|
63
|
+
export declare class GrowableUint16Array extends GrowableTypedArray<Uint16Array> {
|
|
64
|
+
constructor(initial_capacity?: number);
|
|
65
|
+
}
|
|
66
|
+
export declare class GrowableUint32Array extends GrowableTypedArray<Uint32Array> {
|
|
67
|
+
constructor(initial_capacity?: number);
|
|
68
|
+
}
|
|
69
|
+
export declare const TypedArrayFor: {
|
|
70
|
+
readonly f32: typeof GrowableFloat32Array;
|
|
71
|
+
readonly f64: typeof GrowableFloat64Array;
|
|
72
|
+
readonly i8: typeof GrowableInt8Array;
|
|
73
|
+
readonly i16: typeof GrowableInt16Array;
|
|
74
|
+
readonly i32: typeof GrowableInt32Array;
|
|
75
|
+
readonly u8: typeof GrowableUint8Array;
|
|
76
|
+
readonly u16: typeof GrowableUint16Array;
|
|
77
|
+
readonly u32: typeof GrowableUint32Array;
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=typed_arrays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed_arrays.d.ts","sourceRoot":"","sources":["../../../src/type_primitives/typed_arrays/typed_arrays.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;KAWK;AAEL,MAAM,MAAM,aAAa,GACrB,KAAK,GACL,KAAK,GACL,IAAI,GACJ,KAAK,GACL,KAAK,GACL,IAAI,GACJ,KAAK,GACL,KAAK,CAAC;AAEV,MAAM,MAAM,aAAa,GACrB,YAAY,GACZ,YAAY,GACZ,SAAS,GACT,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,GACX,WAAW,CAAC;AAEhB,qBAAa,kBAAkB,CAAC,CAAC,SAAS,aAAa;IAKnD,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJxB,OAAO,CAAC,IAAI,CAAI;IAChB,OAAO,CAAC,IAAI,CAAK;gBAGE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAC,EAC5C,gBAAgB,SAAK;IAKvB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKzB,GAAG,IAAI,MAAM;IAIb,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAItB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAItC;;;OAGG;IACH,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAM9B,KAAK,IAAI,IAAI;IAIb;;;;OAIG;IACH,IAAI,GAAG,IAAI,CAAC,CAEX;IAED;;;OAGG;IACH,IAAI,IAAI,CAAC;IAIT,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC;IAYrC,OAAO,CAAC,KAAK;CAKd;AAED,qBAAa,oBAAqB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;gBAC5D,gBAAgB,SAAK;CAGlC;AAED,qBAAa,oBAAqB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;gBAC5D,gBAAgB,SAAK;CAGlC;AAED,qBAAa,iBAAkB,SAAQ,kBAAkB,CAAC,SAAS,CAAC;gBACtD,gBAAgB,SAAK;CAGlC;AAED,qBAAa,kBAAmB,SAAQ,kBAAkB,CAAC,UAAU,CAAC;gBACxD,gBAAgB,SAAK;CAGlC;AAED,qBAAa,kBAAmB,SAAQ,kBAAkB,CAAC,UAAU,CAAC;gBACxD,gBAAgB,SAAK;CAGlC;AAED,qBAAa,kBAAmB,SAAQ,kBAAkB,CAAC,UAAU,CAAC;gBACxD,gBAAgB,SAAK;CAGlC;AAED,qBAAa,mBAAoB,SAAQ,kBAAkB,CAAC,WAAW,CAAC;gBAC1D,gBAAgB,SAAK;CAGlC;AAED,qBAAa,mBAAoB,SAAQ,kBAAkB,CAAC,WAAW,CAAC;gBAC1D,gBAAgB,SAAK;CAGlC;AAED,eAAO,MAAM,aAAa;;;;;;;;;CAYzB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* Array utilities — helpers for hash-bucketed maps.
|
|
3
|
+
***/
|
|
4
|
+
/** Push a value into a hash-bucket map, creating the bucket array if absent. */
|
|
5
|
+
export declare function bucket_push<T>(map: Map<number, T[]>, key: number, value: T): void;
|
|
6
|
+
//# sourceMappingURL=arrays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../src/utils/arrays.ts"],"names":[],"mappings":"AAAA;;KAEK;AAEL,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,CAAC,EAC3B,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EACrB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,CAAC,GACP,IAAI,CAON"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* Error — Base error types and ECS error categories.
|
|
3
|
+
*
|
|
4
|
+
* AppError is the base class for all application errors, carrying an
|
|
5
|
+
* is_operational flag (recoverable vs programmer error) and optional context.
|
|
6
|
+
* ECSError extends it with an ECS_ERROR category enum for structured matching.
|
|
7
|
+
*
|
|
8
|
+
***/
|
|
9
|
+
export declare abstract class AppError extends Error {
|
|
10
|
+
readonly is_operational: boolean;
|
|
11
|
+
readonly context?: Record<string, unknown> | undefined;
|
|
12
|
+
constructor(message: string, is_operational: boolean, context?: Record<string, unknown> | undefined);
|
|
13
|
+
}
|
|
14
|
+
export declare enum ECS_ERROR {
|
|
15
|
+
EID_MAX_INDEX_OVERFLOW = "EID_MAX_INDEX_OVERFLOW",
|
|
16
|
+
EID_MAX_GEN_OVERFLOW = "EID_MAX_GEN_OVERFLOW",
|
|
17
|
+
COMPONENT_NOT_REGISTERED = "COMPONENT_NOT_REGISTERED",
|
|
18
|
+
ENTITY_NOT_ALIVE = "ENTITY_NOT_ALIVE",
|
|
19
|
+
CIRCULAR_SYSTEM_DEPENDENCY = "CIRCULAR_SYSTEM_DEPENDENCY",
|
|
20
|
+
DUPLICATE_SYSTEM = "DUPLICATE_SYSTEM",
|
|
21
|
+
ARCHETYPE_NOT_FOUND = "ARCHETYPE_NOT_FOUND"
|
|
22
|
+
}
|
|
23
|
+
export declare class ECSError extends AppError {
|
|
24
|
+
readonly category: ECS_ERROR;
|
|
25
|
+
constructor(category: ECS_ERROR, message?: string, context?: Record<string, unknown>);
|
|
26
|
+
}
|
|
27
|
+
export declare function is_ecs_error(error: unknown): error is ECSError;
|
|
28
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":"AAAA;;;;;;;KAOK;AAEL,8BAAsB,QAAS,SAAQ,KAAK;aAGxB,cAAc,EAAE,OAAO;aACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAFjD,OAAO,EAAE,MAAM,EACC,cAAc,EAAE,OAAO,EACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;CAMpD;AAED,oBAAY,SAAS;IACnB,sBAAsB,2BAA2B;IACjD,oBAAoB,yBAAyB;IAC7C,wBAAwB,6BAA6B;IACrD,gBAAgB,qBAAqB;IACrC,0BAA0B,+BAA+B;IACzD,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;CAC5C;AAED,qBAAa,QAAS,SAAQ,QAAQ;aAElB,QAAQ,EAAE,SAAS;gBAAnB,QAAQ,EAAE,SAAS,EACnC,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAIpC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAE9D"}
|
package/dist/world.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { SCHEDULE, SystemEntry } from './schedule';
|
|
2
|
+
import { SystemContext, Query, QueryBuilder, QueryResolver } from './query';
|
|
3
|
+
import { EntityID } from './entity';
|
|
4
|
+
import { ComponentDef, ComponentFields, FieldValues } from './component';
|
|
5
|
+
import { EventDef } from './event';
|
|
6
|
+
import { SystemConfig, SystemDescriptor } from './system';
|
|
7
|
+
import { BitSet } from './type_primitives';
|
|
8
|
+
export declare class World implements QueryResolver {
|
|
9
|
+
private readonly store;
|
|
10
|
+
private readonly schedule;
|
|
11
|
+
private readonly ctx;
|
|
12
|
+
private systems;
|
|
13
|
+
private next_system_id;
|
|
14
|
+
private query_cache;
|
|
15
|
+
private scratch_mask;
|
|
16
|
+
constructor();
|
|
17
|
+
register_component<F extends readonly string[]>(fields: F): ComponentDef<F>;
|
|
18
|
+
register_tag(): ComponentDef<readonly []>;
|
|
19
|
+
register_event<F extends readonly string[]>(fields: F): EventDef<F>;
|
|
20
|
+
register_signal(): EventDef<readonly []>;
|
|
21
|
+
create_entity(): EntityID;
|
|
22
|
+
destroy_entity(id: EntityID): void;
|
|
23
|
+
is_alive(id: EntityID): boolean;
|
|
24
|
+
get entity_count(): number;
|
|
25
|
+
add_component(entity_id: EntityID, def: ComponentDef<readonly []>): void;
|
|
26
|
+
add_component<F extends ComponentFields>(entity_id: EntityID, def: ComponentDef<F>, values: FieldValues<F>): void;
|
|
27
|
+
add_components(entity_id: EntityID, entries: {
|
|
28
|
+
def: ComponentDef<ComponentFields>;
|
|
29
|
+
values?: Record<string, number>;
|
|
30
|
+
}[]): void;
|
|
31
|
+
remove_component(entity_id: EntityID, def: ComponentDef<ComponentFields>): this;
|
|
32
|
+
remove_components(entity_id: EntityID, ...defs: ComponentDef<ComponentFields>[]): void;
|
|
33
|
+
has_component(entity_id: EntityID, def: ComponentDef<ComponentFields>): boolean;
|
|
34
|
+
get_field<F extends ComponentFields>(def: ComponentDef<F>, entity_id: EntityID, field: F[number]): number;
|
|
35
|
+
emit(def: EventDef<readonly []>): void;
|
|
36
|
+
emit<F extends ComponentFields>(def: EventDef<F>, values: FieldValues<F>): void;
|
|
37
|
+
query<T extends ComponentDef<ComponentFields>[]>(...defs: T): Query<T>;
|
|
38
|
+
/** QueryResolver implementation — creates or retrieves a cached Query. */
|
|
39
|
+
_resolve_query(include: BitSet, exclude: BitSet | null, any_of: BitSet | null, defs: readonly ComponentDef<ComponentFields>[]): Query<any>;
|
|
40
|
+
private _find_cached;
|
|
41
|
+
/**
|
|
42
|
+
* Register a system with a typed query.
|
|
43
|
+
*
|
|
44
|
+
* world.register_system(
|
|
45
|
+
* (q, ctx, dt) => q.each((pos, vel, n) => { ... }),
|
|
46
|
+
* (qb) => qb.every(Pos, Vel),
|
|
47
|
+
* );
|
|
48
|
+
*
|
|
49
|
+
* Or with a raw config for systems that don't need a query:
|
|
50
|
+
*
|
|
51
|
+
* world.register_system({ fn(ctx, dt) { ... } });
|
|
52
|
+
*/
|
|
53
|
+
register_system<Defs extends readonly ComponentDef<ComponentFields>[]>(fn: (q: Query<Defs>, ctx: SystemContext, dt: number) => void, query_fn: (qb: QueryBuilder) => Query<Defs>): SystemDescriptor;
|
|
54
|
+
register_system(config: SystemConfig): SystemDescriptor;
|
|
55
|
+
add_systems(label: SCHEDULE, ...entries: (SystemDescriptor | SystemEntry)[]): this;
|
|
56
|
+
remove_system(system: SystemDescriptor): void;
|
|
57
|
+
get system_count(): number;
|
|
58
|
+
startup(): void;
|
|
59
|
+
update(delta_time: number): void;
|
|
60
|
+
flush(): void;
|
|
61
|
+
dispose(): void;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=world.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world.d.ts","sourceRoot":"","sources":["../src/world.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6CK;AAGL,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EACL,aAAa,EACb,KAAK,EACL,YAAY,EACZ,KAAK,aAAa,EAEnB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAe,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AA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