mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 09:30:03 +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
|
local row = record.row
|
||||||
|
|
||||||
archetypeDelete(world, entityId)
|
archetypeDelete(world, entityId)
|
||||||
|
-- TODO: should traverse linked )component records to pairs including entityId
|
||||||
archetypeDelete(world, ECS_PAIR(entityId, WILDCARD))
|
archetypeDelete(world, ECS_PAIR(entityId, WILDCARD))
|
||||||
archetypeDelete(world, ECS_PAIR(WILDCARD, entityId))
|
archetypeDelete(world, ECS_PAIR(WILDCARD, entityId))
|
||||||
|
|
||||||
|
|
|
@ -276,6 +276,7 @@ TEST("world", function()
|
||||||
local bob = world:entity()
|
local bob = world:entity()
|
||||||
local alice = world:entity()
|
local alice = world:entity()
|
||||||
|
|
||||||
|
world:set(bob, Apples, "apples")
|
||||||
world:set(bob, ECS_PAIR(Eats, Apples), "bob eats apples")
|
world:set(bob, ECS_PAIR(Eats, Apples), "bob eats apples")
|
||||||
world:set(alice, ECS_PAIR(Eats, Oranges), "alice eats oranges")
|
world:set(alice, ECS_PAIR(Eats, Oranges), "alice eats oranges")
|
||||||
|
|
||||||
|
@ -287,7 +288,10 @@ TEST("world", function()
|
||||||
count += 1
|
count += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
world:delete(ECS_PAIR(Eats, Apples))
|
||||||
|
|
||||||
CHECK(count == 0)
|
CHECK(count == 0)
|
||||||
|
CHECK(world:get(bob, ECS_PAIR(Eats, Apples)) == nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
do CASE "should error when setting invalid pair"
|
do CASE "should error when setting invalid pair"
|
||||||
|
|
Loading…
Reference in a new issue