mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-24 17:10:03 +00:00
Handle 8 cases
This commit is contained in:
parent
fb47f87bd4
commit
37d5b0415a
1 changed files with 28 additions and 1 deletions
29
lib/init.lua
29
lib/init.lua
|
@ -331,7 +331,7 @@ function World.query(world: World, ...: i53): (() -> (number, ...any)) | () -> (
|
||||||
local components = { ... }
|
local components = { ... }
|
||||||
local archetypes = world.archetypes
|
local archetypes = world.archetypes
|
||||||
local queryLength = #components
|
local queryLength = #components
|
||||||
local a, b, c, d, e = ...
|
local a, b, c, d, e, f, g, h = ...
|
||||||
local firstArchetypeMap = world.componentIndex[components[1]]
|
local firstArchetypeMap = world.componentIndex[components[1]]
|
||||||
if not firstArchetypeMap then
|
if not firstArchetypeMap then
|
||||||
return noop()
|
return noop()
|
||||||
|
@ -444,6 +444,33 @@ function World.query(world: World, ...: i53): (() -> (number, ...any)) | () -> (
|
||||||
columns[archetypeRecords[c]],
|
columns[archetypeRecords[c]],
|
||||||
columns[archetypeRecords[d]],
|
columns[archetypeRecords[d]],
|
||||||
columns[archetypeRecords[e]]
|
columns[archetypeRecords[e]]
|
||||||
|
elseif queryLength == 6 then
|
||||||
|
return entityId,
|
||||||
|
columns[archetypeRecords[a]],
|
||||||
|
columns[archetypeRecords[b]],
|
||||||
|
columns[archetypeRecords[c]],
|
||||||
|
columns[archetypeRecords[d]],
|
||||||
|
columns[archetypeRecords[e]],
|
||||||
|
columns[archetypeRecords[f]]
|
||||||
|
elseif queryLength == 7 then
|
||||||
|
return entityId,
|
||||||
|
columns[archetypeRecords[a]],
|
||||||
|
columns[archetypeRecords[b]],
|
||||||
|
columns[archetypeRecords[c]],
|
||||||
|
columns[archetypeRecords[d]],
|
||||||
|
columns[archetypeRecords[e]],
|
||||||
|
columns[archetypeRecords[f]],
|
||||||
|
columns[archetypeRecords[g]]
|
||||||
|
elseif queryLength == 8 then
|
||||||
|
return entityId,
|
||||||
|
columns[archetypeRecords[a]],
|
||||||
|
columns[archetypeRecords[b]],
|
||||||
|
columns[archetypeRecords[c]],
|
||||||
|
columns[archetypeRecords[d]],
|
||||||
|
columns[archetypeRecords[e]],
|
||||||
|
columns[archetypeRecords[f]],
|
||||||
|
columns[archetypeRecords[g]],
|
||||||
|
columns[archetypeRecords[h]]
|
||||||
end
|
end
|
||||||
|
|
||||||
local queryOutput = {}
|
local queryOutput = {}
|
||||||
|
|
Loading…
Reference in a new issue