mirror of
https://github.com/bakpakin/tiny-ecs.git
synced 2024-11-17 04:44:23 +00:00
Make source pass luacheck. Remove tiny.getSystemIndex().
This commit is contained in:
parent
5997f949cd
commit
d94b178670
13
tiny.lua
13
tiny.lua
@ -41,7 +41,6 @@ local tiny_addSystem
|
|||||||
local tiny_add
|
local tiny_add
|
||||||
local tiny_removeEntity
|
local tiny_removeEntity
|
||||||
local tiny_removeSystem
|
local tiny_removeSystem
|
||||||
local tiny_remove
|
|
||||||
|
|
||||||
--- Filter functions.
|
--- Filter functions.
|
||||||
-- A Filter is a function that selects which Entities apply to a System.
|
-- A Filter is a function that selects which Entities apply to a System.
|
||||||
@ -330,7 +329,7 @@ local function processingSystemUpdate(system, dt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Sorts Systems by a function system.sortDelegate(entity1, entity2) on modify.
|
-- Sorts Systems by a function system.sortDelegate(entity1, entity2) on modify.
|
||||||
local function sortedSystemOnModify(system, dt)
|
local function sortedSystemOnModify(system)
|
||||||
local entities = system.entities
|
local entities = system.entities
|
||||||
local indices = system.indices
|
local indices = system.indices
|
||||||
local sortDelegate = system.sortDelegate
|
local sortDelegate = system.sortDelegate
|
||||||
@ -529,7 +528,6 @@ function tiny.remove(world, ...)
|
|||||||
end
|
end
|
||||||
return ...
|
return ...
|
||||||
end
|
end
|
||||||
tiny_remove = tiny.remove
|
|
||||||
|
|
||||||
-- Adds and removes Systems that have been marked from the World.
|
-- Adds and removes Systems that have been marked from the World.
|
||||||
function tiny_manageSystems(world)
|
function tiny_manageSystems(world)
|
||||||
@ -863,12 +861,6 @@ 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. Returns the old system.index.
|
-- processed first. Returns the old system.index.
|
||||||
@ -905,10 +897,9 @@ 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
|
||||||
},
|
},
|
||||||
__tostring = function(self)
|
__tostring = function()
|
||||||
return "<tiny-ecs_World>"
|
return "<tiny-ecs_World>"
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user