From ce0e466279ccd237ec8b3df5e7ed9275b166e1c7 Mon Sep 17 00:00:00 2001 From: sumneko Date: Mon, 6 May 2019 19:43:43 +0800 Subject: =?UTF-8?q?param=E6=94=AF=E6=8C=81=E5=AD=97=E9=9D=A2=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/emmy/param.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'server/src/emmy/param.lua') diff --git a/server/src/emmy/param.lua b/server/src/emmy/param.lua index 9a2d407f..5894e28e 100644 --- a/server/src/emmy/param.lua +++ b/server/src/emmy/param.lua @@ -29,10 +29,21 @@ function mt:bindGeneric(generic) end end +function mt:addEnum(str) + self._enum[#self._enum+1] = str +end + +function mt:eachEnum(callback) + for _, str in ipairs(self._enum) do + callback(str) + end +end + return function (manager, source) local self = setmetatable({ source = source.id, _manager = manager, + _enum = {}, }, mt) if source.type == 'emmyParam' then self.name = source[1][1] -- cgit v1.2.3