From 92e1b16ba3e6749602f2ea2dcb64a73f11653caa Mon Sep 17 00:00:00 2001 From: sumneko Date: Thu, 18 Apr 2019 20:07:07 +0800 Subject: =?UTF-8?q?field=E6=94=AF=E6=8C=81=20Emmy.class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/vm/emmy.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'server/src/vm/emmy.lua') diff --git a/server/src/vm/emmy.lua b/server/src/vm/emmy.lua index 6e5c2b13..67c620a8 100644 --- a/server/src/vm/emmy.lua +++ b/server/src/vm/emmy.lua @@ -1,15 +1,29 @@ local mt = require 'vm.manager' +function mt:clearEmmy() + self._emmy = nil +end + +function mt:getEmmy() + local emmy = self._emmy + self._emmy = nil + return emmy +end + function mt:doEmmyClass(action) local emmyMgr = self.emmyMgr self:instantSource(action) local class = emmyMgr:addClass(action) - self.emmy = class + self._emmy = class action:set('emmy.class', class) end function mt:doEmmyType(action) local emmyMgr = self.emmyMgr + self:instantSource(action) + local type = emmyMgr:createType() + self._emmy = type + action:set('emmy.type', type) end function mt:doEmmyIncomplete(action) -- cgit v1.2.3