return function(Y,Q)assert(type(Y)=="\115\116\114\105\110\103","\065 \110\097\109\101 \109\117\115\116 \098\101 \112\114\111\118\105\100\101\100 \116\111 \099\114\101\097\116\101 \097\110 \065\099\116\105\111\110")assert(type(Q)=="\102\117\110\099\116\105\111\110","\065 \102\117\110\099\116\105\111\110 \109\117\115\116 \098\101 \112\114\111\118\105\100\101\100 \116\111 \099\114\101\097\116\101 \097\110 \065\099\116\105\111\110")return setmetatable({name=Y},{__call=function(J,...)local p=Q(...)assert(type(p)=="\116\097\098\108\101","\065\110 \097\099\116\105\111\110 \109\117\115\116 \114\101\116\117\114\110 \097 \116\097\098\108\101")p.type=Y return p end})end


return function(name, fn)
    assert(type(name) == "string", "A name must be provided to create an Action")
    assert(type(fn) == "function", "A function must be provided to create an Action")

    return setmetatable({
        name = name,
    }, {
        __call = function(self, ...)
            local result = fn(...)

            assert(type(result) == "table", "An action must return a table")

            result.type = name

            return result
        end
    })
end
