summaryrefslogtreecommitdiff
path: root/server/src/vm/emmy.lua
blob: c83b2d95e6e90c26feb4a048b759098641f60835 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
    action:set('emmy.class', class)
end

function mt:doEmmyType(action)
    local emmyMgr = self.emmyMgr
    self:instantSource(action)
    local type = emmyMgr:createType(action)
    self._emmy = type
    action:set('emmy.type', type)
end

function mt:doEmmyIncomplete(action)
    self:instantSource(action)
end