48,355
edits
No edit summary |
No edit summary |
||
| Line 836: | Line 836: | ||
--[==[Given a list of types as strings, returns true if the language has all of them.]==] | --[==[Given a list of types as strings, returns true if the language has all of them.]==] | ||
function Language:hasType(...) | function Language:hasType(self, ...) | ||
local | local n = select("#", ...) | ||
for i = | if n == 0 then | ||
error("Must specify at least one type.") | |||
end | |||
local types = self:getTypes() | |||
if not types[...] then | |||
return false | |||
elseif n == 1 then | |||
return true | |||
end | |||
local args = {...} | |||
for i = 2, n do | |||
if not types[args[i]] then | if not types[args[i]] then | ||
return false | return false | ||