function Util.MakeEnumType(m,W)local h=Util.MakeFuzzyFinder(W)return{Validate=function(W)return h(W,true)~=nil,("\086\097\108\117\101 \037\113 \105\115 \110\111\116 \097 \118\097\108\105\100 \037\115\046"):format(W,m)end,Autocomplete=function(m)local W=h(m)return type(W[1])~="\115\116\114\105\110\103"and Util.GetNames(W)or W end,Parse=function(m)return h(m,true)end}end

function Util.MakeEnumType(name, values)
	local findValue = Util.MakeFuzzyFinder(values)
	return {
		Validate = function(text)
			return findValue(text, true) ~= nil, ("Value %q is not a valid %s."):format(text, name)
		end,
		Autocomplete = function(text)
			local list = findValue(text)
			return type(list[1]) ~= "string" and Util.GetNames(list) or list
		end,
		Parse = function(text)
			return findValue(text, true)
		end
	}
end
