Remove ROOT_ARCHETYPE in world initializer

This commit is contained in:
Ukendio 2024-04-26 19:11:54 +02:00
parent ffca213183
commit 201383dcac

View file

@ -156,7 +156,6 @@ function World.new()
nextId = 0, nextId = 0,
nextArchetypeId = 0 nextArchetypeId = 0
}, World) }, World)
self.ROOT_ARCHETYPE = archetypeOf(self, {}, nil)
return self return self
end end
@ -164,7 +163,6 @@ type World = typeof(World.new())
local function ensureArchetype(world: World, types, prev) local function ensureArchetype(world: World, types, prev)
if #types < 1 then if #types < 1 then
if not world.ROOT_ARCHETYPE then if not world.ROOT_ARCHETYPE then
local ROOT_ARCHETYPE = archetypeOf(world, {}, nil) local ROOT_ARCHETYPE = archetypeOf(world, {}, nil)
world.ROOT_ARCHETYPE = ROOT_ARCHETYPE world.ROOT_ARCHETYPE = ROOT_ARCHETYPE
@ -451,6 +449,6 @@ function World.query(world: World, ...: i53): (() -> (number, ...any)) | () -> (
end end
end end
return { return table.freeze({
World = World World = World
} })