mirror of
https://github.com/bakpakin/tiny-ecs.git
synced 2026-07-22 07:56:52 -06:00
Readd tiny.getSystemIndex(world, system)
This commit is contained in:
@@ -680,9 +680,15 @@ function tiny.getSystemCount(world)
|
|||||||
return #(world.systems)
|
return #(world.systems)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Gets the index of the System in the World.
|
||||||
|
-- A simpler alternative is `system.index`.
|
||||||
|
function tiny.getSystemIndex(world, system)
|
||||||
|
return system.index
|
||||||
|
end
|
||||||
|
|
||||||
--- Sets the index of a System in the World, and returns the old index. Changes
|
--- Sets the index of a System in the World, and returns the old index. Changes
|
||||||
-- the order in which they Systems processed, because lower indexed Systems are
|
-- the order in which they Systems processed, because lower indexed Systems are
|
||||||
-- processed first.
|
-- processed first. Returns the old system.index.
|
||||||
function tiny.setSystemIndex(world, system, index)
|
function tiny.setSystemIndex(world, system, index)
|
||||||
local oldIndex = system.index
|
local oldIndex = system.index
|
||||||
local systems = world.systems
|
local systems = world.systems
|
||||||
@@ -711,6 +717,7 @@ worldMetaTable = {
|
|||||||
clearSystems = tiny.clearSystems,
|
clearSystems = tiny.clearSystems,
|
||||||
getEntityCount = tiny.getEntityCount,
|
getEntityCount = tiny.getEntityCount,
|
||||||
getSystemCount = tiny.getSystemCount,
|
getSystemCount = tiny.getSystemCount,
|
||||||
|
getSystemIndex = tiny.getSystemIndex,
|
||||||
setSystemIndex = tiny.setSystemIndex
|
setSystemIndex = tiny.setSystemIndex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user