mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 06:41:55 +00:00
work on enum system
This commit is contained in:
@@ -144,7 +144,6 @@ function ButtonsModule:CreatePromptButtons()
|
||||
warn(`{self.Model}: Door tag was present but couldnt specify its type for use "{TagName}"`)
|
||||
end
|
||||
})
|
||||
|
||||
print(`{self.Model}: created a ProximityPrompt @ "{Inst:GetFullName()}"`)
|
||||
end
|
||||
|
||||
|
||||
@@ -53,22 +53,19 @@ CustomEnum.Enums = setmetatable({}, EnumMeta)
|
||||
local function EnumMethods(Enum)
|
||||
--Branch these out later
|
||||
function Enum:Match(Result: string, MatchList: MatchList_f): MatchResult
|
||||
local Return: MatchResult = nil
|
||||
local LastIndexName, LastIndexValue = next(MatchList)
|
||||
|
||||
for MatchEnumName: string, EnumFunc in MatchList do
|
||||
if MatchEnumName == Result then
|
||||
Return = type(EnumFunc) == "function" and EnumFunc() or EnumFunc
|
||||
break
|
||||
return type(EnumFunc) == "function" and EnumFunc() or EnumFunc
|
||||
elseif MatchEnumName == LastIndexName and LastIndexValue ~= nil and MatchList['_'] then
|
||||
return type(MatchList['_']) == "function" and MatchList['_']() or MatchList['_']
|
||||
end
|
||||
end
|
||||
if Return ~= nil and MatchList["_"] then
|
||||
Return = MatchList["_"]()
|
||||
end
|
||||
return Return
|
||||
return nil
|
||||
end
|
||||
|
||||
function Enum:MatchThread(Result: string, MatchList: MatchList_f): (boolean, MatchResult)
|
||||
task.synchronize()
|
||||
function Enum:MatchOnThread(Result: string, MatchList: MatchList_f): (boolean, MatchResult)
|
||||
return coroutine.resume(coroutine.create(function()
|
||||
return self:Match(Result, MatchList)
|
||||
end))
|
||||
|
||||
Reference in New Issue
Block a user