mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-24 17:10:03 +00:00
Compare commits
3 commits
54fe7298e9
...
9d5d1954a6
Author | SHA1 | Date | |
---|---|---|---|
|
9d5d1954a6 | ||
|
62af051e7a | ||
|
a5dad9aa4d |
3 changed files with 18 additions and 1 deletions
|
@ -950,6 +950,7 @@ local function archetype_delete(world: World, archetype: Archetype, row: number,
|
|||
record_to_move.row = row
|
||||
end
|
||||
|
||||
delete = entities[row]
|
||||
entities[row] = move
|
||||
end
|
||||
|
||||
|
|
|
@ -1045,6 +1045,22 @@ TEST("world:component()", function()
|
|||
end)
|
||||
|
||||
TEST("world:delete", function()
|
||||
do CASE "invoke OnRemove hooks"
|
||||
local world = world_new()
|
||||
|
||||
local e1 = world:entity()
|
||||
local e2 = world:entity()
|
||||
|
||||
local Stable = world:component()
|
||||
world:set(Stable, jecs.OnRemove, function(e)
|
||||
CHECK(e == e1)
|
||||
end)
|
||||
|
||||
world:set(e1, Stable, true)
|
||||
world:set(e2, Stable, true)
|
||||
|
||||
world:delete(e1)
|
||||
end
|
||||
do CASE "delete recycled entity id used as component"
|
||||
local world = world_new()
|
||||
local id = world:entity()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "ukendio/jecs"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
registry = "https://github.com/UpliftGames/wally-index"
|
||||
realm = "shared"
|
||||
license = "MIT"
|
||||
|
|
Loading…
Reference in a new issue