Sync to upstream Jecs 0.6.1-nightly.20250611T001113Z
This commit is contained in:
parent
d1e5f16bea
commit
b734386e7f
8 changed files with 35 additions and 24 deletions
|
@ -2,6 +2,14 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 0.6.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Entity types now unions with numbers should allow for easier time casting while not causing regressing previous behaviours
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed a critical bug with `(*, R)` pairs not being removed when `R` is deleted
|
||||||
|
|
||||||
## 0.6.0
|
## 0.6.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
modified = ["addons/observers.luau", "jecs.luau"]
|
modified = ["CHANGELOG.md", "jecs.luau"]
|
||||||
version = "0.6.0-nightly.20250608T001058Z"
|
version = "0.6.1-nightly.20250611T001113Z"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
--!optimize 2
|
--!optimize 2
|
||||||
--!native
|
--!native
|
||||||
--!strict
|
--!strict
|
||||||
|
@ -825,7 +826,7 @@ local function world_entity(world: ecs_world_t, entity: i53?): i53
|
||||||
return entity
|
return entity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return entity_index_new_id(entity_index, entity)
|
return entity_index_new_id(entity_index)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function world_parent(world: ecs_world_t, entity: i53)
|
local function world_parent(world: ecs_world_t, entity: i53)
|
||||||
|
@ -1051,7 +1052,7 @@ local function world_remove(world: ecs_world_t, entity: i53, id: i53)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function archetype_fast_delete_last(columns: { Column }, column_count: number, types: { i53 }, entity: i53)
|
local function archetype_fast_delete_last(columns: { Column }, column_count: number)
|
||||||
for i, column in columns do
|
for i, column in columns do
|
||||||
if column ~= NULL_ARRAY then
|
if column ~= NULL_ARRAY then
|
||||||
column[column_count] = nil
|
column[column_count] = nil
|
||||||
|
@ -1059,7 +1060,7 @@ local function archetype_fast_delete_last(columns: { Column }, column_count: num
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function archetype_fast_delete(columns: { Column }, column_count: number, row, types, entity)
|
local function archetype_fast_delete(columns: { Column }, column_count: number, row: number)
|
||||||
for i, column in columns do
|
for i, column in columns do
|
||||||
if column ~= NULL_ARRAY then
|
if column ~= NULL_ARRAY then
|
||||||
column[row] = column[column_count]
|
column[row] = column[column_count]
|
||||||
|
@ -1101,9 +1102,9 @@ local function archetype_delete(world: ecs_world_t, archetype: ecs_archetype_t,
|
||||||
entities[last] = nil :: any
|
entities[last] = nil :: any
|
||||||
|
|
||||||
if row == last then
|
if row == last then
|
||||||
archetype_fast_delete_last(columns, column_count, id_types, delete)
|
archetype_fast_delete_last(columns, column_count)
|
||||||
else
|
else
|
||||||
archetype_fast_delete(columns, column_count, row, id_types, delete)
|
archetype_fast_delete(columns, column_count, row)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1409,14 +1410,14 @@ local function world_delete(world: ecs_world_t, entity: i53)
|
||||||
local tr = idr_r_archetype.records[rel]
|
local tr = idr_r_archetype.records[rel]
|
||||||
local tr_count = idr_r_archetype.counts[rel]
|
local tr_count = idr_r_archetype.counts[rel]
|
||||||
local types = idr_r_archetype.types
|
local types = idr_r_archetype.types
|
||||||
for i = tr, tr_count do
|
for i = tr, tr + tr_count - 1 do
|
||||||
ids[types[tr]] = true
|
ids[types[i]] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local n = #entities
|
local n = #entities
|
||||||
table.move(entities, 1, n, count + 1, children)
|
table.move(entities, 1, n, count + 1, children)
|
||||||
count += n
|
count += n
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, child in children do
|
for _, child in children do
|
||||||
for id in ids do
|
for id in ids do
|
||||||
world_remove(world, child, id)
|
world_remove(world, child, id)
|
||||||
|
@ -2525,8 +2526,8 @@ end
|
||||||
|
|
||||||
World.new = world_new
|
World.new = world_new
|
||||||
|
|
||||||
export type Entity<T = any> = { __T: T }
|
export type Entity<T = any> = number | { __T: T }
|
||||||
export type Id<T = any> = { __T: T }
|
export type Id<T = any> = number | { __T: T }
|
||||||
export type Pair<P, O> = Id<P>
|
export type Pair<P, O> = Id<P>
|
||||||
type ecs_id_t<T=unknown> = Id<T> | Pair<T, "Tag"> | Pair<"Tag", T>
|
type ecs_id_t<T=unknown> = Id<T> | Pair<T, "Tag"> | Pair<"Tag", T>
|
||||||
export type Item<T...> = (self: Query<T...>) -> (Entity, T...)
|
export type Item<T...> = (self: Query<T...>) -> (Entity, T...)
|
||||||
|
@ -2601,10 +2602,10 @@ export type World = {
|
||||||
& (<T, a, b, c, d>(World, Entity<T>, Id<a>, Id<b>, Id<c>, Id<d>) -> (a?, b?, c?, d?)),
|
& (<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.
|
--- Returns whether the entity has the ID.
|
||||||
has: (<T>(World, Entity<T>, Id) -> boolean)
|
has: (<T, a>(World, Entity<T>, Id<a>) -> boolean)
|
||||||
& (<T>(World, Entity<T>, Id, Id) -> boolean)
|
& (<T, a, b >(World, Entity<T>, Id<a>, Id<a>) -> boolean)
|
||||||
& (<T>(World, Entity<T>, Id, Id, Id) -> boolean)
|
& (<T, a, b, c>(World, Entity<T>, Id<a>, Id<b>, Id<c>) -> boolean)
|
||||||
& <T>(World, Entity<T>, Id, Id, Id, Id) -> boolean,
|
& <T, a, b, c, d>(World, Entity<T>, Id<a>, Id<b>, Id<c>, Id<d>) -> boolean,
|
||||||
|
|
||||||
--- Get parent (target of ChildOf relationship) for entity. If there is no ChildOf relationship pair, it will return nil.
|
--- Get parent (target of ChildOf relationship) for entity. If there is no ChildOf relationship pair, it will return nil.
|
||||||
parent: <T>(self: World, entity: Entity<T>) -> Entity,
|
parent: <T>(self: World, entity: Entity<T>) -> Entity,
|
||||||
|
|
|
@ -3,7 +3,7 @@ includes = ["init.luau", "pesde.toml", "README.md", "CHANGELOG.md", "LICENSE", "
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "marked/jecs_nightly"
|
name = "marked/jecs_nightly"
|
||||||
repository = "https://git.devmarked.win/marked/jecs-nightly"
|
repository = "https://git.devmarked.win/marked/jecs-nightly"
|
||||||
version = "0.6.0-nightly.20250608T001058Z"
|
version = "0.6.1-nightly.20250611T001113Z"
|
||||||
|
|
||||||
[indices]
|
[indices]
|
||||||
default = "https://github.com/pesde-pkg/index"
|
default = "https://github.com/pesde-pkg/index"
|
||||||
|
|
|
@ -3,7 +3,7 @@ includes = ["init.luau", "pesde.toml", "README.md", "CHANGELOG.md", "LICENSE", "
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "marked/jecs_nightly"
|
name = "marked/jecs_nightly"
|
||||||
repository = "https://git.devmarked.win/marked/jecs-nightly"
|
repository = "https://git.devmarked.win/marked/jecs-nightly"
|
||||||
version = "0.6.0-nightly.20250608T001058Z"
|
version = "0.6.1-nightly.20250611T001113Z"
|
||||||
|
|
||||||
[indices]
|
[indices]
|
||||||
default = "https://github.com/pesde-pkg/index"
|
default = "https://github.com/pesde-pkg/index"
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
passed = true
|
passed = true
|
||||||
timestamp = "20250610T001109Z"
|
timestamp = "20250611T001114Z"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
[38;1m7.6[0m [33;1mus[0m [38;1m 2[0m [33;1mkB[0m[38;1m│[0m [38;1mdelete children of entity[0m
|
-------
|
||||||
[38;1m9.1[0m [33;1mus[0m [38;1m 1[0m [33;1mkB[0m[38;1m│[0m [38;1mremove friends of entity[0m
|
[38;1m7.5[0m [33;1mus[0m [38;1m 2[0m [33;1mkB[0m[38;1m│[0m [38;1mdelete children of entity[0m
|
||||||
[38;1m345[0m [32;1mns[0m [38;1m 0[0m [32;1m B[0m[38;1m│[0m [38;1msimple deletion of entity[0m
|
[38;1m8.8[0m [33;1mus[0m [38;1m 1[0m [33;1mkB[0m[38;1m│[0m [38;1mremove friends of entity[0m
|
||||||
|
[38;1m352[0m [32;1mns[0m [38;1m 0[0m [32;1m B[0m[38;1m│[0m [38;1msimple deletion of entity[0m
|
||||||
[37;1mrepro[0m
|
[37;1mrepro[0m
|
||||||
[38;5;208mNONE[0m[38;1m│[0m [38;1m[0m
|
[38;5;208mNONE[0m[38;1m│[0m [38;1m[0m
|
||||||
|
|
||||||
|
@ -25,6 +26,7 @@
|
||||||
[32;1mPASS[0m[38;1m│[0m [38;1mshould not exist after delete[0m
|
[32;1mPASS[0m[38;1m│[0m [38;1mshould not exist after delete[0m
|
||||||
|
|
||||||
[37;1mworld:delete()[0m
|
[37;1mworld:delete()[0m
|
||||||
|
[32;1mPASS[0m[38;1m│[0m [38;1mremove (*, R) pairs when relationship is invalidated[0m
|
||||||
[32;1mPASS[0m[38;1m│[0m [38;1mremove pair when relationship is deleted[0m
|
[32;1mPASS[0m[38;1m│[0m [38;1mremove pair when relationship is deleted[0m
|
||||||
[32;1mPASS[0m[38;1m│[0m [38;1minvoke OnRemove hook on all components of deleted entity[0m
|
[32;1mPASS[0m[38;1m│[0m [38;1minvoke OnRemove hook on all components of deleted entity[0m
|
||||||
[32;1mPASS[0m[38;1m│[0m [38;1minvoke OnRemove hook on relationship if target was deleted[0m
|
[32;1mPASS[0m[38;1m│[0m [38;1minvoke OnRemove hook on relationship if target was deleted[0m
|
||||||
|
@ -121,5 +123,5 @@
|
||||||
[32;1mPASS[0m[38;1m│[0m [38;1m#2[0m
|
[32;1mPASS[0m[38;1m│[0m [38;1m#2[0m
|
||||||
[32;1mPASS[0m[38;1m│[0m [38;1m#3[0m
|
[32;1mPASS[0m[38;1m│[0m [38;1m#3[0m
|
||||||
|
|
||||||
[38;1m74/74 test cases passed in 32.600 ms.[0m
|
[38;1m75/75 test cases passed in 33.345 ms.[0m
|
||||||
[32;1m0 fails[0m
|
[32;1m0 fails[0m
|
||||||
|
|
|
@ -5,4 +5,4 @@ license = "MIT"
|
||||||
name = "mark-marks/jecs-nightly"
|
name = "mark-marks/jecs-nightly"
|
||||||
realm = "shared"
|
realm = "shared"
|
||||||
registry = "https://github.com/UpliftGames/wally-index"
|
registry = "https://github.com/UpliftGames/wally-index"
|
||||||
version = "0.6.0-nightly.20250608T001058Z"
|
version = "0.6.1-nightly.20250611T001113Z"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue