Class emmy lua

main
4n0n 2 years ago
parent fa5a42b0fb
commit 7d1b7560fa
  1. 3
      .gitignore
  2. 7
      src/Class/Class.lua

3
.gitignore vendored

@ -7,3 +7,6 @@ DS_Store
## ignore all files in scripts ## ignore all files in scripts
scripts/* scripts/*
## ignore vscode settings
.vscode/*

@ -19,6 +19,9 @@ function Class:__index(k)
end end
-- Constructor -- Constructor
---@param locale string
---@param name string
---@param id number
function Class:New(locale, name, id) function Class:New(locale, name, id)
local self = setmetatable({}, Class) local self = setmetatable({}, Class)
self.class = { self.class = {
@ -30,21 +33,25 @@ function Class:New(locale, name, id)
end end
-- Get the classes locale -- Get the classes locale
---@return string
function Class:GetLocale() function Class:GetLocale()
return self.class.locale return self.class.locale
end end
-- Get the classes name -- Get the classes name
---@return string
function Class:GetName() function Class:GetName()
return self.class.name return self.class.name
end end
-- Get the classes id -- Get the classes id
---@return number
function Class:GetID() function Class:GetID()
return self.class.id return self.class.id
end end
-- Return the classes color -- Return the classes color
---@return ColorMixin classColor
function Class:GetColor() function Class:GetColor()
return C_ClassColor.GetClassColor(self.class.name) return C_ClassColor.GetClassColor(self.class.name)
end end

Loading…
Cancel
Save