Automate naming process

This commit is contained in:
Tjakka5 2019-12-22 23:07:42 +01:00
parent e0f88025ba
commit 144a42dc9e
7 changed files with 78 additions and 53 deletions

View file

@ -2,7 +2,6 @@
local PATH = (...):gsub('%.[^%.]+$', '')
local Systems = require(PATH..".systems")
local Pool = require(PATH..".pool")
local System = {}
@ -36,20 +35,13 @@ System.mt = {
--- Creates a new System prototype.
-- @param ... Variable amounts of filters
-- @return A new System prototype
function System.new(name, ...)
if (type(name) ~= "string") then
error("bad argument #1 to 'System.new' (string expected, got "..type(name)..")", 2)
end
function System.new(...)
local baseSystem = setmetatable({
__name = name,
__isBaseSystem = true,
__filter = {...},
}, System.mt)
baseSystem.__index = baseSystem
Systems.register(name, baseSystem)
return baseSystem
end