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