From 5c19a3b595c04ec5de413bfd0b706da7fff707c3 Mon Sep 17 00:00:00 2001 From: maeriil <104389763+maeriil@users.noreply.github.com> Date: Fri, 31 Jan 2025 09:29:32 -0500 Subject: [PATCH 1/6] Typescript Types for Archetypes * resolves #182 - TS types for Archetypes * description for archetype query * updated archetype number type --- jecs.d.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/jecs.d.ts b/jecs.d.ts index 136dcb9..c5288de 100644 --- a/jecs.d.ts +++ b/jecs.d.ts @@ -40,6 +40,23 @@ type FlattenTuple = T extends [infer U] ? U : LuaTuple; type Nullable = { [K in keyof T]: T[K] | undefined }; type InferComponents = { [K in keyof A]: InferComponent }; +type ArchetypeId = number +type Column = unknown[]; + +type ArchetypeRecord = { + count: number; + column: number; +} + +export type Archetype = { + id: number; + types: number[]; + type: string; + entities: number[]; + columns: Column[]; + records: ArchetypeRecord[]; +} + type Iter = IterableFunction>; export type CachedQuery = { @@ -47,6 +64,12 @@ export type CachedQuery = { * Returns an iterator that produces a tuple of [Entity, ...queriedComponents]. */ iter(): Iter; + + /** + * Returns the matched archetypes of the query + * @returns An array of archetypes of the query + */ + archetypes(): Archetype[]; } & Iter; export type Query = { @@ -75,6 +98,12 @@ export type Query = { * @returns A new Query with the exclusion applied. */ without(...components: Id[]): Query; + + /** + * Returns the matched archetypes of the query + * @returns An array of archetypes of the query + */ + archetypes(): Archetype[]; } & Iter; export class World { From f91ed9f24bc0dad67f5ed7d0f5966e21e5b44ebd Mon Sep 17 00:00:00 2001 From: EncodedVenom <32179912+EncodedVenom@users.noreply.github.com> Date: Sun, 2 Feb 2025 19:06:11 -0500 Subject: [PATCH 2/6] Bump analysis.yaml --- .github/workflows/analysis.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/analysis.yaml b/.github/workflows/analysis.yaml index 18da7bc..9535921 100644 --- a/.github/workflows/analysis.yaml +++ b/.github/workflows/analysis.yaml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v4 - name: Install Luau - uses: encodedvenom/install-luau@v2.1 + uses: encodedvenom/install-luau@v4.3 - name: Analyze run: | From aac91bb8ff2ad10235c4cc9a7c7019ca25d07381 Mon Sep 17 00:00:00 2001 From: Saber <88921984+SaberClass@users.noreply.github.com> Date: Tue, 4 Feb 2025 15:21:19 -0400 Subject: [PATCH 3/6] Update relationships.md (#184) removed duplicate descrption for 'find first target of a relationship' and fixed the incorrect typescript (I hope) example of getting the parent of an entity --- docs/learn/concepts/relationships.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/docs/learn/concepts/relationships.md b/docs/learn/concepts/relationships.md index 10faf2d..f9aff16 100644 --- a/docs/learn/concepts/relationships.md +++ b/docs/learn/concepts/relationships.md @@ -47,22 +47,10 @@ Get parent for entity world:parent(bob) ``` ```typescript [typescript] -world.parent(bob, pair(Eats, jecs.Wildcard) +world.parent(bob) ``` ::: -Find first target of a relationship for entity - -:::code-group -```luau [luau] -world:target(bob, Eats) -``` -```typescript [typescript] -world.target(bob, Eats) -``` -::: - - Find first target of a relationship for entity :::code-group From 57fd564aa7de84a3016307db27e3cb8cab7a98f3 Mon Sep 17 00:00:00 2001 From: Clown Date: Fri, 7 Feb 2025 01:18:41 -0500 Subject: [PATCH 4/6] Add planck to addons page (#185) --- docs/learn/concepts/addons.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/learn/concepts/addons.md b/docs/learn/concepts/addons.md index 8207f70..4a667fc 100644 --- a/docs/learn/concepts/addons.md +++ b/docs/learn/concepts/addons.md @@ -21,3 +21,8 @@ An ergonomic, runtime agnostic scheduler for Jecs ## [jam](https://github.com/revvy02/Jam) Provides hooks and a scheduler that implements jabby and a topographical runtime + +## [planck](https://github.com/YetAnotherClown/planck) + +An agnostic scheduler inspired by Bevy and Flecs, with core features including phases, pipelines, run conditions, and startup systems. +Planck also provides plugins for Jabby, Matter Hooks, and more. \ No newline at end of file From 1d1b7b099aa0bd798ca0d6f6cb7d8c6354c12cf7 Mon Sep 17 00:00:00 2001 From: Saber <88921984+SaberClass@users.noreply.github.com> Date: Fri, 7 Feb 2025 06:01:54 -0400 Subject: [PATCH 5/6] Update relationships.md (#184) removed duplicate descrption for 'find first target of a relationship' and fixed the incorrect typescript (I hope) example of getting the parent of an entity From 6ec0b0bb8bfb9a85c1dfc7bf5f5d4871f9946b03 Mon Sep 17 00:00:00 2001 From: Ketasaja Date: Sun, 9 Feb 2025 19:37:20 +0000 Subject: [PATCH 6/6] Change entity type (#189) --- jecs.luau | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jecs.luau b/jecs.luau index c0b4cf3..f8b3bd6 100644 --- a/jecs.luau +++ b/jecs.luau @@ -2196,7 +2196,7 @@ function World.new() return self end -export type Entity = number & { __T: T } +export type Entity = {__T: T} export type Id = | Entity