"clear" function for all entity's fragments removing

This commit is contained in:
BlackMATov
2024-11-24 10:59:44 +07:00
parent 5ee7745759
commit cd3f895d15
3 changed files with 32 additions and 0 deletions
+18
View File
@@ -97,6 +97,24 @@ do
assert(e:get(f) == 21)
end
do
local f1, f2 = evo.registry.entity(), evo.registry.entity()
local e = evo.registry.entity()
assert(e:insert(f1))
assert(e:insert(f2))
assert(e:is_alive())
assert(e.__chunk == evo.registry.chunk(f1, f2))
assert(e:clear())
assert(e:is_alive())
assert(e.__chunk == nil)
assert(not e:clear())
assert(e:is_alive())
assert(e.__chunk == nil)
end
do
local f1, f2 = evo.registry.entity(), evo.registry.entity()