Compare commits

...

2 commits

Author SHA1 Message Date
forgejo-actions
d9d18543bd Sync to upstream Jecs 0.6.0-nightly.20250602T001103Z 2025-06-02 00:11:21 +00:00
92ff6f8488 Sync to released Jecs 0.6.0-nightly.20250528T001102Z (#81)
Reviewed-on: #81
2025-06-01 02:11:22 +02:00
7 changed files with 29 additions and 28 deletions

View file

@ -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"

View file

@ -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: <T>(self: World) -> Entity<T>,
--- 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: <T>(self: World, id: Entity, relation: Id<T>, index: number?) -> Entity?,
target: <T, a>(self: World, id: Entity<T>, relation: Id<a>, index: number?) -> Entity?,
--- Deletes an entity and all it's related components and relationships.
delete: (self: World, id: Entity) -> (),
delete: <T>(self: World, id: Entity<T>) -> (),
--- Adds a component to the entity with no value
add: <T>(self: World, id: Entity, component: Id<T>) -> (),
add: <T, a>(self: World, id: Entity<T>, component: Id<a>) -> (),
--- Assigns a value to a component on the given entity
set: <T>(self: World, id: Entity, component: Id<T>, data: T) -> (),
set: <T, a>(self: World, id: Entity<T>, component: Id<a>, data: a) -> (),
cleanup: (self: World) -> (),
-- Clears an entity from the world
clear: <T>(self: World, id: Id<T>) -> (),
clear: <a>(self: World, id: Id<a>) -> (),
--- Removes a component from the given entity
remove: <T>(self: World, id: Entity, component: Id<T>) -> (),
remove: <T, a>(self: World, id: Entity<T>, component: Id<a>) -> (),
--- Retrieves the value of up to 4 components. These values may be nil.
get: (<A>(self: World, id: Entity, Id<A>) -> A?)
& (<A, B>(self: World, id: Entity, Id<A>, Id<B>) -> (A?, B?))
& (<A, B, C>(self: World, id: Entity, Id<A>, Id<B>, Id<C>) -> (A?, B?, C?))
& <A, B, C, D>(self: World, id: Entity, Id<A>, Id<B>, Id<C>, Id<D>) -> (A?, B?, C?, D?),
get: & (<T, a>(World, Entity<T>, Id<a>) -> a?)
& (<T, a, b>(World, Entity<T>, Id<a>, Id<b>) -> (a?, b?))
& (<T, a, b, c>(World, Entity<T>, Id<a>, Id<b>, Id<c>) -> (a?, b?, c?))
& (<T, a, b, c, d>(World, Entity<T>, Id<a>, Id<b>, Id<c>, Id<d>) -> (a?, b?, c?, d?)),
--- Returns whether the entity has the ID.
has: (<A>(World, Entity, A) -> boolean)
& (<A, B>(World, Entity, A, B) -> boolean)
& (<A, B, C>(World, Entity, A, B, C) -> boolean)
& <A, B, C, D>(World, Entity, A, B, C, D) -> boolean,
has: (<T>(World, Entity<T>, Id) -> boolean)
& (<T>(World, Entity<T>, Id, Id) -> boolean)
& (<T>(World, Entity<T>, Id, Id, Id) -> boolean)
& <T>(World, Entity<T>, 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: <T>(self: World, entity: Entity<T>) -> Entity,
--- Checks if the world contains the given entity
contains:(self: World, entity: Entity) -> boolean,
contains: <T>(self: World, entity: Entity<T>) -> boolean,
--- Checks if the entity exists
exists: (self: World, entity: Entity) -> boolean,
exists: <T>(self: World, entity: Entity<T>) -> boolean,
each: <T>(self: World, id: Id<T>) -> () -> Entity,

View file

@ -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"

View file

@ -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"

View file

@ -1,2 +1,2 @@
passed = true
timestamp = "20250531T001106Z"
timestamp = "20250602T001105Z"

View file

@ -1,6 +1,6 @@
7.4 us  3 kB│ delete children of entity
8.9 us  1 kB│ remove friends of entity
387 ns  10  B│ simple deletion of entity
7.5 us  3 kB│ delete children of entity
9.4 us  1 kB│ remove friends of entity
347 ns  10  B│ simple deletion of entity
repro
NONE│ 
@ -121,5 +121,5 @@
PASS│ #2
PASS│ #3
74/74 test cases passed in 32.803 ms.
74/74 test cases passed in 30.658 ms.
0 fails

View file

@ -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"