mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 01:20:04 +00:00
Add todo
This commit is contained in:
parent
5533cd1c64
commit
6c2f47bf70
2 changed files with 8 additions and 3 deletions
|
@ -436,6 +436,7 @@ function World.delete(world: World, entityId: i53)
|
|||
local row = record.row
|
||||
|
||||
archetypeDelete(world, entityId)
|
||||
-- TODO: should traverse linked )component records to pairs including entityId
|
||||
archetypeDelete(world, ECS_PAIR(entityId, WILDCARD))
|
||||
archetypeDelete(world, ECS_PAIR(WILDCARD, entityId))
|
||||
|
||||
|
|
|
@ -276,6 +276,7 @@ TEST("world", function()
|
|||
local bob = world:entity()
|
||||
local alice = world:entity()
|
||||
|
||||
world:set(bob, Apples, "apples")
|
||||
world:set(bob, ECS_PAIR(Eats, Apples), "bob eats apples")
|
||||
world:set(alice, ECS_PAIR(Eats, Oranges), "alice eats oranges")
|
||||
|
||||
|
@ -287,7 +288,10 @@ TEST("world", function()
|
|||
count += 1
|
||||
end
|
||||
|
||||
world:delete(ECS_PAIR(Eats, Apples))
|
||||
|
||||
CHECK(count == 0)
|
||||
CHECK(world:get(bob, ECS_PAIR(Eats, Apples)) == nil)
|
||||
end
|
||||
|
||||
do CASE "should error when setting invalid pair"
|
||||
|
|
Loading…
Reference in a new issue