diff --git a/jecs/build.txt b/jecs/build.txt index c283828..16ea6a7 100644 --- a/jecs/build.txt +++ b/jecs/build.txt @@ -1,2 +1,2 @@ -modified = ["README.md", "addons/observers.luau"] -version = "0.6.0-nightly.20250528T001102Z" +modified = ["jecs.luau"] +version = "0.6.0-nightly.20250602T001103Z" diff --git a/jecs/jecs.luau b/jecs/jecs.luau index 0270110..7531134 100644 --- a/jecs/jecs.luau +++ b/jecs/jecs.luau @@ -1,3 +1,4 @@ + --!optimize 2 --!native --!strict @@ -117,6 +118,7 @@ local ECS_ID_MASK = 0b00 local ECS_ENTITY_MASK = bit32.lshift(1, 24) local ECS_GENERATION_MASK = bit32.lshift(1, 16) +local ECS_PAIR_OFFSET = 2^48 local NULL_ARRAY = table.freeze({}) :: Column local NULL = newproxy(false) @@ -168,7 +170,6 @@ end local function ECS_COMBINE(id: number, generation: number): i53 return id + (generation * ECS_ENTITY_MASK) end -local ECS_PAIR_OFFSET = 2^48 local function ECS_IS_PAIR(e: number): boolean return e > ECS_PAIR_OFFSET @@ -2576,40 +2577,40 @@ export type World = { component: (self: World) -> Entity, --- Gets the target of an relationship. For example, when a user calls --- `world:target(id, ChildOf(parent), 0)`, you will obtain the parent entity. - target: (self: World, id: Entity, relation: Id, index: number?) -> Entity?, + target: (self: World, id: Entity, relation: Id, index: number?) -> Entity?, --- Deletes an entity and all it's related components and relationships. - delete: (self: World, id: Entity) -> (), + delete: (self: World, id: Entity) -> (), --- Adds a component to the entity with no value - add: (self: World, id: Entity, component: Id) -> (), + add: (self: World, id: Entity, component: Id) -> (), --- Assigns a value to a component on the given entity - set: (self: World, id: Entity, component: Id, data: T) -> (), + set: (self: World, id: Entity, component: Id, data: a) -> (), cleanup: (self: World) -> (), -- Clears an entity from the world - clear: (self: World, id: Id) -> (), + clear: (self: World, id: Id) -> (), --- Removes a component from the given entity - remove: (self: World, id: Entity, component: Id) -> (), + remove: (self: World, id: Entity, component: Id) -> (), --- Retrieves the value of up to 4 components. These values may be nil. - get: ((self: World, id: Entity, Id) -> A?) - & ((self: World, id: Entity, Id, Id) -> (A?, B?)) - & ((self: World, id: Entity, Id, Id, Id) -> (A?, B?, C?)) - & (self: World, id: Entity, Id, Id, Id, Id) -> (A?, B?, C?, D?), + get: & ((World, Entity, Id) -> a?) + & ((World, Entity, Id, Id) -> (a?, b?)) + & ((World, Entity, Id, Id, Id) -> (a?, b?, c?)) + & ((World, Entity, Id, Id, Id, Id) -> (a?, b?, c?, d?)), --- Returns whether the entity has the ID. - has: ((World, Entity, A) -> boolean) - & ((World, Entity, A, B) -> boolean) - & ((World, Entity, A, B, C) -> boolean) - & (World, Entity, A, B, C, D) -> boolean, + has: ((World, Entity, Id) -> boolean) + & ((World, Entity, Id, Id) -> boolean) + & ((World, Entity, Id, Id, Id) -> boolean) + & (World, Entity, Id, Id, Id, Id) -> boolean, --- Get parent (target of ChildOf relationship) for entity. If there is no ChildOf relationship pair, it will return nil. - parent:(self: World, entity: Entity) -> Entity, + parent: (self: World, entity: Entity) -> Entity, --- Checks if the world contains the given entity - contains:(self: World, entity: Entity) -> boolean, + contains: (self: World, entity: Entity) -> boolean, --- Checks if the entity exists - exists: (self: World, entity: Entity) -> boolean, + exists: (self: World, entity: Entity) -> boolean, each: (self: World, id: Id) -> () -> Entity, diff --git a/jecs/pesde-rbx.toml b/jecs/pesde-rbx.toml index 936c888..496c83f 100644 --- a/jecs/pesde-rbx.toml +++ b/jecs/pesde-rbx.toml @@ -3,7 +3,7 @@ includes = ["init.luau", "pesde.toml", "README.md", "CHANGELOG.md", "LICENSE", " license = "MIT" name = "marked/jecs_nightly" repository = "https://git.devmarked.win/marked/jecs-nightly" -version = "0.6.0-nightly.20250528T001102Z" +version = "0.6.0-nightly.20250602T001103Z" [indices] default = "https://github.com/pesde-pkg/index" diff --git a/jecs/pesde.toml b/jecs/pesde.toml index 347be85..51e8159 100644 --- a/jecs/pesde.toml +++ b/jecs/pesde.toml @@ -3,7 +3,7 @@ includes = ["init.luau", "pesde.toml", "README.md", "CHANGELOG.md", "LICENSE", " license = "MIT" name = "marked/jecs_nightly" repository = "https://git.devmarked.win/marked/jecs-nightly" -version = "0.6.0-nightly.20250528T001102Z" +version = "0.6.0-nightly.20250602T001103Z" [indices] default = "https://github.com/pesde-pkg/index" diff --git a/jecs/test.txt b/jecs/test.txt index 19b65bc..5b12147 100644 --- a/jecs/test.txt +++ b/jecs/test.txt @@ -1,2 +1,2 @@ passed = true -timestamp = "20250601T001108Z" +timestamp = "20250603T001100Z" diff --git a/jecs/test_fulllog.txt b/jecs/test_fulllog.txt index 52c7abb..485badb 100644 --- a/jecs/test_fulllog.txt +++ b/jecs/test_fulllog.txt @@ -1,6 +1,6 @@ - 11 us  3 kB│ delete children of entity - 12 us  1 kB│ remove friends of entity -434 ns  10  B│ simple deletion of entity +7.3 us  3 kB│ delete children of entity +9.1 us  1 kB│ remove friends of entity +513 ns  10  B│ simple deletion of entity repro NONE│  @@ -121,5 +121,5 @@ PASS│ #2 PASS│ #3 -74/74 test cases passed in 31.068 ms. +74/74 test cases passed in 32.550 ms. 0 fails diff --git a/jecs/wally.toml b/jecs/wally.toml index 74ece88..ea87491 100644 --- a/jecs/wally.toml +++ b/jecs/wally.toml @@ -5,4 +5,4 @@ license = "MIT" name = "mark-marks/jecs-nightly" realm = "shared" registry = "https://github.com/UpliftGames/wally-index" -version = "0.6.0-nightly.20250528T001102Z" +version = "0.6.0-nightly.20250602T001103Z"