pull/1/head
LyLoLoq 1 year ago
parent d5b0ccf42b
commit 630fcfc3d9
  1. 15
      src/Class/Class.lua
  2. 7
      src/Command/Command.lua
  3. 4
      src/List/List.lua
  4. 5
      src/MythicPlusUtils/MythicPlusUtils.lua
  5. 7
      src/ObjectManager/ObjectManager.lua
  6. 6
      src/Unit/Unit.lua

@ -18,12 +18,21 @@ function Class:__index(k)
return response
end
---@class Class
---@field class Class.class
---@class Class.class
---@field locale string
---@field name string
---@field id number
-- Constructor
---@param locale string
---@param name string
---@param id number
function Class:New(locale, name, id)
local self = setmetatable({}, Class)
self.class = {
locale = locale,
name = name,
@ -50,10 +59,16 @@ function Class:GetID()
return self.class.id
end
---@class ColorMixin
---@field r number
---@field g number
---@field b number
-- Return the classes color
---@return ColorMixin classColor
function Class:GetColor()
return C_ClassColor.GetClassColor(self.class.name)
end
return Class

@ -1,6 +1,13 @@
-- Create a wow command handler class
---@class Command
---@field command string
---@field commands Command.commands[]
local Command = {}
---@class Command.commands
---@field helpmsg string
---@field cb fun(args: table)
Command.__index = Command
---@return string

@ -1,5 +1,3 @@
local Tinkr, Bastion = ...
---@class List
local List = {
-- Add overload
@ -144,7 +142,7 @@ function List:findIndex(callback)
return nil
end
---@param callback fun(value: any): boolean
---@param callback fun(...): boolean
---@return nil
function List:sort(callback)
table.sort(self._list, callback)

@ -17,6 +17,7 @@ MythicPlusUtils.__index = MythicPlusUtils
function MythicPlusUtils:New()
local self = setmetatable({}, MythicPlusUtils)
---@diagnostic disable-next-line: assign-type-mismatch
self.random = math.random(1000000, 9999999)
self.aoeBosses = {
@ -567,8 +568,4 @@ function MythicPlusUtils:IsAOEBoss(unit)
return self.aoeBosses[unit:GetID()]
end
function MythicPlusUtils:IsTankBuster(spell)
return self.tankBusters[spell:GetID()]
end
return MythicPlusUtils

@ -1,6 +1,11 @@
local Tinkr, Bastion = ...
---@class ObjectManager
---@field _lists table
---@field enemies List
---@field friends List
---@field activeEnemies List
---@field explosives List
local ObjectManager = {}
ObjectManager.__index = ObjectManager
@ -20,7 +25,7 @@ end
-- Register a custom list with a callback
---@param name string
---@param cb function
---@return List
---@return List | false
function ObjectManager:RegisterList(name, cb)
if self._lists[name] then
return false

@ -505,7 +505,7 @@ end
-- Check if unit is interruptible
---@param percent number
---@param ignoreInterruptible boolean
---@param ignoreInterruptible? boolean
---@return boolean
function Unit:IsInterruptibleAt(percent, ignoreInterruptible)
if not ignoreInterruptible and not self:IsInterruptible() then
@ -933,7 +933,6 @@ function Unit:IsStealthed()
local Shadowmeld = Bastion.SpellBook:GetSpell(58984)
local Sepsis = Bastion.SpellBook:GetSpell(328305)
return self:GetAuras():FindAny(Stealth) or self:GetAuras():FindAny(ShadowDance)
end
@ -1107,6 +1106,7 @@ end
---@param Target Unit
---@param Angle number
---@param Distance number
---@param rotation? number
---@return boolean
function Unit:IsWithinCone(Target, Angle, Distance, rotation)
if not Target:Exists() then
@ -1114,7 +1114,7 @@ function Unit:IsWithinCone(Target, Angle, Distance, rotation)
end
local angle = self:GetAngle(Target)
local rotation = rotation or self:GetFacing()
rotation = rotation or self:GetFacing()
local diff = math.abs(angle - rotation)

Loading…
Cancel
Save