mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 01:20:04 +00:00
Move root archetype (#33)
This commit is contained in:
parent
517dbb99c0
commit
887c892c2e
1 changed files with 2 additions and 0 deletions
|
@ -190,6 +190,7 @@ function World.new()
|
||||||
nextEntityId = 0;
|
nextEntityId = 0;
|
||||||
ROOT_ARCHETYPE = (nil :: any) :: Archetype;
|
ROOT_ARCHETYPE = (nil :: any) :: Archetype;
|
||||||
}, World)
|
}, World)
|
||||||
|
self.ROOT_ARCHETYPE = archetypeOf(self, {}, nil)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -272,6 +273,7 @@ local function ensureEdge(archetype: Archetype, componentId: i53)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function archetypeTraverseAdd(world: World, componentId: i53, from: Archetype): Archetype
|
local function archetypeTraverseAdd(world: World, componentId: i53, from: Archetype): Archetype
|
||||||
|
from = from or world.ROOT_ARCHETYPE
|
||||||
if not from then
|
if not from then
|
||||||
-- If there was no source archetype then it should return the ROOT_ARCHETYPE
|
-- If there was no source archetype then it should return the ROOT_ARCHETYPE
|
||||||
local ROOT_ARCHETYPE = world.ROOT_ARCHETYPE
|
local ROOT_ARCHETYPE = world.ROOT_ARCHETYPE
|
||||||
|
|
Loading…
Reference in a new issue