mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 14:51:55 +00:00
Enum module and types
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
--!optimize 2
|
||||
--!native
|
||||
--!strict
|
||||
|
||||
local RS: ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local Enum = require(RS:WaitForChild("Enum"))
|
||||
|
||||
|
||||
@@ -19,9 +19,8 @@ type CustonEnumsFunctions = {
|
||||
Remove: (Name: EnumName) -> ()
|
||||
}
|
||||
|
||||
--type MatchList = {
|
||||
-- [EnumValue]
|
||||
--}
|
||||
type MatchResult = any?
|
||||
type MatchList_f = {[string]: (...any?) -> MatchResult}
|
||||
|
||||
local CustomEnum = {} :: CustomEnums
|
||||
local EnumMeta = {} :: EnumsMetadata
|
||||
@@ -51,8 +50,9 @@ end
|
||||
CustomEnum.Enums = setmetatable({}, EnumMeta)
|
||||
|
||||
local function EnumMethods(Enum)
|
||||
function Enum:Match(Result: string, MatchList) --Branch this out later
|
||||
local Return: any? = nil
|
||||
--Branch this out later
|
||||
function Enum:Match(Result: string, MatchList: MatchList_f): MatchResult
|
||||
local Return: MatchResult = nil
|
||||
local b: boolean = false
|
||||
|
||||
for MatchEnumName, EnumFunc in MatchList do
|
||||
|
||||
Reference in New Issue
Block a user