summaryrefslogtreecommitdiff
path: root/script/emmy/return.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/emmy/return.lua')
-rw-r--r--script/emmy/return.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/script/emmy/return.lua b/script/emmy/return.lua
new file mode 100644
index 00000000..1fc97923
--- /dev/null
+++ b/script/emmy/return.lua
@@ -0,0 +1,36 @@
+local listMgr = require 'vm.list'
+
+---@class EmmyReturn
+local mt = {}
+mt.__index = mt
+mt.type = 'emmy.return'
+
+function mt:getSource()
+ return listMgr.get(self.source)
+end
+
+function mt:bindType(type)
+ if type then
+ self._bindType = type
+ else
+ return self._bindType
+ end
+end
+
+function mt:bindGeneric(generic)
+ if generic then
+ self._bindGeneric = generic
+ else
+ return self._bindGeneric
+ end
+end
+
+return function (manager, source, name)
+ local self = setmetatable({
+ source = source.id,
+ name = name and name[1],
+ option = source.option,
+ _manager = manager,
+ }, mt)
+ return self
+end