diff --git a/src/APL/APL.lua b/src/APL/APL.lua index ebb1f4a..0356ff6 100644 --- a/src/APL/APL.lua +++ b/src/APL/APL.lua @@ -1,4 +1,5 @@ -- Create an APL trait for the APL class +---@class APLTrait local APLTrait = {} APLTrait.__index = APLTrait @@ -29,6 +30,7 @@ function APLTrait:__tostring() end -- Create an APL actor for the APL class +---@class APLActor local APLActor = {} APLActor.__index = APLActor @@ -116,7 +118,7 @@ function APLActor:__tostring() end -- APL (Attack priority list) class - +---@class APL local APL = {} APL.__index = APL diff --git a/src/Aura/Aura.lua b/src/Aura/Aura.lua index a1ca4e9..91f2b62 100644 --- a/src/Aura/Aura.lua +++ b/src/Aura/Aura.lua @@ -1,6 +1,7 @@ local Tinkr, Bastion = ... -- Create a new Aura class +---@class Aura local Aura = {} function Aura:__index(k) diff --git a/src/AuraTable/AuraTable.lua b/src/AuraTable/AuraTable.lua index 893e106..577208b 100644 --- a/src/AuraTable/AuraTable.lua +++ b/src/AuraTable/AuraTable.lua @@ -1,6 +1,7 @@ local Tinkr, Bastion = ... -- Create a new AuraTable class +---@class AuraTable local AuraTable = {} AuraTable.__index = AuraTable @@ -196,6 +197,7 @@ function AuraTable:Clear() end -- Check if the unit has a specific aura +---@return Aura function AuraTable:Find(spell) local auras = self:GetUnitAuras() local aurasub = auras[spell:GetID()] @@ -217,6 +219,7 @@ function AuraTable:Find(spell) return Bastion.Aura:New() end +---@return Aura function AuraTable:FindMy(spell) local aurasub = self.playerAuras[spell:GetID()] @@ -238,6 +241,7 @@ function AuraTable:FindMy(spell) end -- Find any +---@return Aura function AuraTable:FindAny(spell) local a = self:Find(spell) if a:IsValid() then diff --git a/src/Cache/Cache.lua b/src/Cache/Cache.lua index a88f0b0..d2c75c1 100644 --- a/src/Cache/Cache.lua +++ b/src/Cache/Cache.lua @@ -1,3 +1,4 @@ +---@class Cache local Cache = {} Cache.__index = Cache diff --git a/src/Cacheable/Cacheable.lua b/src/Cacheable/Cacheable.lua index b344814..41cb8e1 100644 --- a/src/Cacheable/Cacheable.lua +++ b/src/Cacheable/Cacheable.lua @@ -1,6 +1,7 @@ local Tinkr, Bastion = ... -- Define a Cacheable class +---@class Cacheable local Cacheable = { cache = nil, callback = nil, diff --git a/src/Class/Class.lua b/src/Class/Class.lua index d9c4a97..a553475 100644 --- a/src/Class/Class.lua +++ b/src/Class/Class.lua @@ -1,6 +1,7 @@ local Tinkr, Bastion = ... -- Create a new Class class +---@class Class local Class = {} function Class:__index(k) diff --git a/src/ClassMagic/ClassMagic.lua b/src/ClassMagic/ClassMagic.lua index b4bef57..8b6f747 100644 --- a/src/ClassMagic/ClassMagic.lua +++ b/src/ClassMagic/ClassMagic.lua @@ -1,6 +1,8 @@ +---@class ClassMagic local ClassMagic = {} ClassMagic.__index = ClassMagic +---@return any function ClassMagic:Resolve(Class, key) if Class[key] or Class[key] == false then return Class[key] diff --git a/src/Command/Command.lua b/src/Command/Command.lua index 1341ed9..f8c69fb 100644 --- a/src/Command/Command.lua +++ b/src/Command/Command.lua @@ -1,5 +1,5 @@ -- Create a wow command handler class - +---@class Command local Command = {} Command.__index = Command diff --git a/src/EventManager/EventManager.lua b/src/EventManager/EventManager.lua index 28775bc..b880614 100644 --- a/src/EventManager/EventManager.lua +++ b/src/EventManager/EventManager.lua @@ -1,5 +1,5 @@ -- Create an EventManager class - +---@class EventManager local EventManager = { events = {}, eventHandlers = {}, diff --git a/src/Item/Item.lua b/src/Item/Item.lua index 205c638..f774457 100644 --- a/src/Item/Item.lua +++ b/src/Item/Item.lua @@ -1,6 +1,7 @@ local Tinkr, Bastion = ... -- Create a new Item class +---@class Item local Item = { UsableIfFunc = false, PreUseFunc = false, diff --git a/src/ItemBook/ItemBook.lua b/src/ItemBook/ItemBook.lua index 9b3eebb..32fadb5 100644 --- a/src/ItemBook/ItemBook.lua +++ b/src/ItemBook/ItemBook.lua @@ -1,6 +1,7 @@ local Tinkr, Bastion = ... -- Create a new ItemBook class +---@class ItemBook local ItemBook = {} ItemBook.__index = ItemBook diff --git a/src/List/List.lua b/src/List/List.lua index bc03ebe..95c4f47 100644 --- a/src/List/List.lua +++ b/src/List/List.lua @@ -1,5 +1,6 @@ local Tinkr, Bastion = ... +---@class List local List = {} List.__index = List diff --git a/src/Module/Module.lua b/src/Module/Module.lua index 6c19d98..5c853dc 100644 --- a/src/Module/Module.lua +++ b/src/Module/Module.lua @@ -1,5 +1,6 @@ -- Create a module class for a bastion module +---@class Module local Module = {} Module.__index = Module diff --git a/src/MythicPlusUtils/MythicPlusUtils.lua b/src/MythicPlusUtils/MythicPlusUtils.lua index 4dac63f..7d7e201 100644 --- a/src/MythicPlusUtils/MythicPlusUtils.lua +++ b/src/MythicPlusUtils/MythicPlusUtils.lua @@ -1,5 +1,6 @@ local Tinkr, Bastion = ... +---@class MythicPlusUtils local MythicPlusUtils = { debuffLogging = false, random = '' diff --git a/src/NotificationsList/NotificationsList.lua b/src/NotificationsList/NotificationsList.lua index 7572d07..29d191c 100644 --- a/src/NotificationsList/NotificationsList.lua +++ b/src/NotificationsList/NotificationsList.lua @@ -1,5 +1,6 @@ -- Create a NotificationsList class +---@class NotificationsList local NotificationsList = { notifications = {} } @@ -29,6 +30,7 @@ function NotificationsList:New() end -- Create a notification class for the notifications list (takes icon and text) +---@class Notification local Notification = { } Notification.__index = Notification diff --git a/src/ObjectManager/ObjectManager.lua b/src/ObjectManager/ObjectManager.lua index d90b561..7855cc8 100644 --- a/src/ObjectManager/ObjectManager.lua +++ b/src/ObjectManager/ObjectManager.lua @@ -1,5 +1,6 @@ local Tinkr, Bastion = ... +---@class ObjectManager local ObjectManager = {} ObjectManager.__index = ObjectManager diff --git a/src/Refreshable/Refreshable.lua b/src/Refreshable/Refreshable.lua index 1018c1c..b53cbe5 100644 --- a/src/Refreshable/Refreshable.lua +++ b/src/Refreshable/Refreshable.lua @@ -1,6 +1,7 @@ local Tinkr, Bastion = ... -- Define a Refreshable class +---@class Refreshable local Refreshable = { cache = nil, callback = nil, diff --git a/src/Spell/Spell.lua b/src/Spell/Spell.lua index a474928..1831e46 100644 --- a/src/Spell/Spell.lua +++ b/src/Spell/Spell.lua @@ -1,6 +1,7 @@ local Tinkr, Bastion = ... -- Create a new Spell class +---@class Spell local Spell = { CastableIfFunc = false, PreCastFunc = false, diff --git a/src/SpellBook/SpellBook.lua b/src/SpellBook/SpellBook.lua index b06f69f..952596f 100644 --- a/src/SpellBook/SpellBook.lua +++ b/src/SpellBook/SpellBook.lua @@ -1,10 +1,12 @@ local Tinkr, Bastion = ... -- Create a new SpellBook class +---@class SpellBook local SpellBook = {} SpellBook.__index = SpellBook -- Constructor +---@return SpellBook function SpellBook:New() local self = setmetatable({}, SpellBook) self.spells = {} @@ -12,6 +14,7 @@ function SpellBook:New() end -- Get a spell from the spellbook +---@return Spell function SpellBook:GetSpell(id) if self.spells[id] == nil then self.spells[id] = Bastion.Spell:New(id) @@ -20,6 +23,7 @@ function SpellBook:GetSpell(id) return self.spells[id] end +---@return Spell function SpellBook:GetIfRegistered(id) return self.spells[id] end diff --git a/src/Timer/Timer.lua b/src/Timer/Timer.lua index 14ec866..15adcc9 100644 --- a/src/Timer/Timer.lua +++ b/src/Timer/Timer.lua @@ -1,6 +1,7 @@ local Tinkr, Bastion = ... -- Create a new Timer class +---@class Timer local Timer = { startTime = nil, resetAfterCombat = false, diff --git a/src/Unit/Unit.lua b/src/Unit/Unit.lua index 138d5b9..aef5ee3 100644 --- a/src/Unit/Unit.lua +++ b/src/Unit/Unit.lua @@ -1,9 +1,12 @@ local Tinkr, Bastion = ... -- Create a new Unit class +---@class Unit local Unit = { cache = nil, + ---@type AuraTable aura_table = nil, + ---@type Unit unit = nil, last_shadow_techniques = 0, swings_since_sht = 0, @@ -226,6 +229,7 @@ function Unit:GetClass() end -- Get the units auras +---@return AuraTable function Unit:GetAuras() return self.aura_table end @@ -669,7 +673,7 @@ function Unit:IsStealthed() local Sepsis = Bastion.SpellBook:GetSpell(328305) - return self:GetAuras():FindAny(Stealth) or self:GetAuras():FindAny(ShadowDance) + return self:GetAuras():FindAny(Stealth) or self:GetAuras():FindAny(ShadowDance) end -- Get unit swing timers diff --git a/src/UnitManager/UnitManager.lua b/src/UnitManager/UnitManager.lua index 53a6b54..b7fa7e1 100644 --- a/src/UnitManager/UnitManager.lua +++ b/src/UnitManager/UnitManager.lua @@ -48,6 +48,7 @@ local function Validate(token) end -- Create a new UnitManager class +---@class UnitManager local UnitManager = { units = {}, customUnits = {}, @@ -108,6 +109,7 @@ function UnitManager:Validate(token) end -- Get or create a unit +---@return Unit function UnitManager:Get(token) -- if not Validate(token) then -- error("UnitManager:Get - Invalid token: " .. token) diff --git a/src/Vector3/Vector3.lua b/src/Vector3/Vector3.lua index 406d9be..0aaabf8 100644 --- a/src/Vector3/Vector3.lua +++ b/src/Vector3/Vector3.lua @@ -1,5 +1,6 @@ -- Create a Vector3 class +---@class Vector3 local Vector3 = {} Vector3.__index = Vector3 diff --git a/src/_bastion.lua b/src/_bastion.lua index 4c54103..955230e 100644 --- a/src/_bastion.lua +++ b/src/_bastion.lua @@ -1,5 +1,6 @@ local Tinkr = ... +---@class Bastion local Bastion = { DebugMode = false } @@ -9,30 +10,54 @@ function Bastion.require(class) return Tinkr:require("scripts/bastion/src/" .. class .. "/" .. class, Bastion) end +---@type ClassMagic Bastion.ClassMagic = Bastion.require("ClassMagic") +---@type List Bastion.List = Bastion.require("List") +---@type NotificationsList, Notification Bastion.NotificationsList, Bastion.Notification = Bastion.require("NotificationsList") +---@type Vector3 Bastion.Vector3 = Bastion.require("Vector3") +---@type Command Bastion.Command = Bastion.require("Command") +---@type Cache Bastion.Cache = Bastion.require("Cache") +---@type Cacheable Bastion.Cacheable = Bastion.require("Cacheable") +---@type Refreshable Bastion.Refreshable = Bastion.require("Refreshable") +---@type Unit Bastion.Unit = Bastion.require("Unit") +---@type Aura Bastion.Aura = Bastion.require("Aura") +---@type APL, APLActor, APLTrait Bastion.APL, Bastion.APLActor, Bastion.APLTrait = Bastion.require("APL") Bastion.Module = Bastion.require("Module") +---@type UnitManager Bastion.UnitManager = Bastion.require("UnitManager"):New() +---@type ObjectManager Bastion.ObjectManager = Bastion.require("ObjectManager"):New() +---@type EventManager Bastion.EventManager = Bastion.require("EventManager"):New() +---@type Spell Bastion.Spell = Bastion.require("Spell") +---@type SpellBook Bastion.SpellBook = Bastion.require("SpellBook"):New() +---@type Item Bastion.Item = Bastion.require("Item") +---@type ItemBook Bastion.ItemBook = Bastion.require("ItemBook"):New() +---@type AuraTable Bastion.AuraTable = Bastion.require("AuraTable") +---@type Class Bastion.Class = Bastion.require("Class") +---@type Timer Bastion.Timer = Bastion.require("Timer") +---@type Timer Bastion.CombatTimer = Bastion.Timer:New('combat') +---@type MythicPlusUtils Bastion.MythicPlusUtils = Bastion.require("MythicPlusUtils"):New() +---@type NotificationsList Bastion.Notifications = Bastion.NotificationsList:New() Bastion.modules = {}