From 4aca3ab192714b32b9bab675d5d92cc61a4f13d7 Mon Sep 17 00:00:00 2001
From: Ukendio
Date: Sun, 10 Nov 2024 04:14:08 +0100
Subject: [PATCH 1/3] Ignore stylua
---
src/init.luau | 64 +++++++++++++++++++++++++--------------------------
1 file changed, 31 insertions(+), 33 deletions(-)
diff --git a/src/init.luau b/src/init.luau
index fc7c0ea..7cb467d 100644
--- a/src/init.luau
+++ b/src/init.luau
@@ -61,8 +61,8 @@ type IdRecord = {
hooks: {
on_add: ((entity: i53) -> ())?,
on_set: ((entity: i53, data: any) -> ())?,
- on_remove: ((entity: i53) -> ())?
- }
+ on_remove: ((entity: i53) -> ())?,
+ },
}
type ComponentIndex = Map
@@ -75,32 +75,32 @@ type ArchetypeDiff = {
}
local HI_COMPONENT_ID = _G.__JECS_HI_COMPONENT_ID or 256
+-- stylua: ignore start
+local EcsOnAdd = HI_COMPONENT_ID + 1
+local EcsOnRemove = HI_COMPONENT_ID + 2
+local EcsOnSet = HI_COMPONENT_ID + 3
+local EcsWildcard = HI_COMPONENT_ID + 4
+local EcsChildOf = HI_COMPONENT_ID + 5
+local EcsComponent = HI_COMPONENT_ID + 6
+local EcsOnDelete = HI_COMPONENT_ID + 7
+local EcsOnDeleteTarget = HI_COMPONENT_ID + 8
+local EcsDelete = HI_COMPONENT_ID + 9
+local EcsRemove = HI_COMPONENT_ID + 10
+local EcsName = HI_COMPONENT_ID + 11
+local EcsRest = HI_COMPONENT_ID + 12
-local EcsOnAdd = HI_COMPONENT_ID + 1
-local EcsOnRemove = HI_COMPONENT_ID + 2
-local EcsOnSet = HI_COMPONENT_ID + 3
-local EcsWildcard = HI_COMPONENT_ID + 4
-local EcsChildOf = HI_COMPONENT_ID + 5
-local EcsComponent = HI_COMPONENT_ID + 6
-local EcsOnDelete = HI_COMPONENT_ID + 7
-local EcsOnDeleteTarget = HI_COMPONENT_ID + 8
-local EcsDelete = HI_COMPONENT_ID + 9
-local EcsRemove = HI_COMPONENT_ID + 10
-local EcsName = HI_COMPONENT_ID + 11
-local EcsRest = HI_COMPONENT_ID + 12
-
-local ECS_PAIR_FLAG = 0x8
-local ECS_ID_FLAGS_MASK = 0x10
-local ECS_ENTITY_MASK = bit32.lshift(1, 24)
+local ECS_PAIR_FLAG = 0x8
+local ECS_ID_FLAGS_MASK = 0x10
+local ECS_ENTITY_MASK = bit32.lshift(1, 24)
local ECS_GENERATION_MASK = bit32.lshift(1, 16)
-local ECS_ID_DELETE = 0b0000_0001
-local ECS_ID_IS_TAG = 0b0000_0010
-local ECS_ID_HAS_ON_ADD = 0b0000_0100
-local ECS_ID_HAS_ON_SET = 0b0000_1000
-local ECS_ID_HAS_ON_REMOVE = 0b0001_0000
-local ECS_ID_MASK = 0b0000_0000
-
+local ECS_ID_DELETE = 0b0000_0001
+local ECS_ID_IS_TAG = 0b0000_0010
+local ECS_ID_HAS_ON_ADD = 0b0000_0100
+local ECS_ID_HAS_ON_SET = 0b0000_1000
+local ECS_ID_HAS_ON_REMOVE = 0b0001_0000
+local ECS_ID_MASK = 0b0000_0000
+-- stylua: ignore end
local NULL_ARRAY = table.freeze({}) :: Column
local function FLAGS_ADD(is_pair: boolean): number
@@ -293,7 +293,7 @@ local world_get: (world: World, entityId: i53, a: i53, b: i53?, c: i53?, d: i53?
do
-- Keeping the function as small as possible to enable inlining
local records: { ArchetypeRecord }
- local columns: {{ any }}
+ local columns: { { any } }
local row: number
local function fetch(id): any
@@ -394,7 +394,7 @@ local function world_has(world: World, entity: number, ...: i53): boolean
end
local function world_target(world: World, entity: i53, relation: i24, index: number?): i24?
- local nth = index or 0
+ local nth = index or 0
local record = world.entityIndex.sparse[entity]
local archetype = record.archetype
if not archetype then
@@ -642,8 +642,7 @@ local function init_edge_for_add(world, archetype, edge: GraphEdge, id, to)
end
end
-local function init_edge_for_remove(world: World, archetype: Archetype,
- edge: GraphEdge, id: number, to: Archetype)
+local function init_edge_for_remove(world: World, archetype: Archetype, edge: GraphEdge, id: number, to: Archetype)
archetype_init_edge(archetype, edge, id, to)
archetype_ensure_edge(world, archetype.node.remove, id)
if archetype ~= to then
@@ -1659,7 +1658,7 @@ end
export type Id = Entity | Pair, Entity>
export type Pair = number & {
- __relation: First
+ __relation: First,
}
-- type function _Pair(first, second)
@@ -1672,12 +1671,11 @@ export type Pair = number & {
-- end
-- end
-
--- type TestPair = _Pair, Entity>
+-- type TestPair = _Pair, Entity>
type Item = (self: Query) -> (Entity, T...)
-export type Entity = number & { read __T: T }
+export type Entity = number & { __T: T }
type Iter = (query: Query) -> () -> (Entity, T...)
From 1e11c2f338ab51cc7f0a9636918256d5377bf9fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?shameless=E2=9C=B0?=
<143651343+daolgierd@users.noreply.github.com>
Date: Sun, 10 Nov 2024 22:46:36 +0000
Subject: [PATCH 2/3] Update README.md (#152)
Changed license name from Apache 2.0 to MIT
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 0b1694b..9e5a24d 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
-[](LICENSE-APACHE) [](https://wally.run/package/ukendio/jecs)
+[](LICENSE) [](https://wally.run/package/ukendio/jecs)
Just a stupidly fast Entity Component System
From 7259ad59b5050162b4eb2aa02a7b5d3d091c6f08 Mon Sep 17 00:00:00 2001
From: marked
Date: Tue, 12 Nov 2024 20:22:41 +0100
Subject: [PATCH 3/3] packaging(wally): Add license to package and manifest
---
wally.toml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/wally.toml b/wally.toml
index 285a254..e20bfd8 100644
--- a/wally.toml
+++ b/wally.toml
@@ -3,6 +3,7 @@ name = "ukendio/jecs"
version = "0.3.2"
registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"
+license = "MIT"
include = [
"default.project.json",
"src/**",
@@ -10,5 +11,6 @@ include = [
"wally.toml",
"README.md",
"CHANGELOG.md",
+ "LICENSE",
]
exclude = ["**"]