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:
File diff suppressed because one or more lines are too long
@@ -1,3 +1,7 @@
|
|||||||
|
--!optimize 2
|
||||||
|
--!native
|
||||||
|
--!strict
|
||||||
|
|
||||||
local RS: ReplicatedStorage = game:GetService("ReplicatedStorage")
|
local RS: ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
local Enum = require(RS:WaitForChild("Enum"))
|
local Enum = require(RS:WaitForChild("Enum"))
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,8 @@ type CustonEnumsFunctions = {
|
|||||||
Remove: (Name: EnumName) -> ()
|
Remove: (Name: EnumName) -> ()
|
||||||
}
|
}
|
||||||
|
|
||||||
--type MatchList = {
|
type MatchResult = any?
|
||||||
-- [EnumValue]
|
type MatchList_f = {[string]: (...any?) -> MatchResult}
|
||||||
--}
|
|
||||||
|
|
||||||
local CustomEnum = {} :: CustomEnums
|
local CustomEnum = {} :: CustomEnums
|
||||||
local EnumMeta = {} :: EnumsMetadata
|
local EnumMeta = {} :: EnumsMetadata
|
||||||
@@ -51,8 +50,9 @@ end
|
|||||||
CustomEnum.Enums = setmetatable({}, EnumMeta)
|
CustomEnum.Enums = setmetatable({}, EnumMeta)
|
||||||
|
|
||||||
local function EnumMethods(Enum)
|
local function EnumMethods(Enum)
|
||||||
function Enum:Match(Result: string, MatchList) --Branch this out later
|
--Branch this out later
|
||||||
local Return: any? = nil
|
function Enum:Match(Result: string, MatchList: MatchList_f): MatchResult
|
||||||
|
local Return: MatchResult = nil
|
||||||
local b: boolean = false
|
local b: boolean = false
|
||||||
|
|
||||||
for MatchEnumName, EnumFunc in MatchList do
|
for MatchEnumName, EnumFunc in MatchList do
|
||||||
|
|||||||
Reference in New Issue
Block a user