add base emmylua types

main
Sundance Kid 2 years ago
parent 0b329a6463
commit 1187848e67
  1. 4
      src/APL/APL.lua
  2. 1
      src/Aura/Aura.lua
  3. 4
      src/AuraTable/AuraTable.lua
  4. 1
      src/Cache/Cache.lua
  5. 1
      src/Cacheable/Cacheable.lua
  6. 1
      src/Class/Class.lua
  7. 2
      src/ClassMagic/ClassMagic.lua
  8. 2
      src/Command/Command.lua
  9. 2
      src/EventManager/EventManager.lua
  10. 1
      src/Item/Item.lua
  11. 1
      src/ItemBook/ItemBook.lua
  12. 1
      src/List/List.lua
  13. 1
      src/Module/Module.lua
  14. 1
      src/MythicPlusUtils/MythicPlusUtils.lua
  15. 2
      src/NotificationsList/NotificationsList.lua
  16. 1
      src/ObjectManager/ObjectManager.lua
  17. 1
      src/Refreshable/Refreshable.lua
  18. 1
      src/Spell/Spell.lua
  19. 4
      src/SpellBook/SpellBook.lua
  20. 1
      src/Timer/Timer.lua
  21. 6
      src/Unit/Unit.lua
  22. 2
      src/UnitManager/UnitManager.lua
  23. 1
      src/Vector3/Vector3.lua
  24. 25
      src/_bastion.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

@ -1,6 +1,7 @@
local Tinkr, Bastion = ...
-- Create a new Aura class
---@class Aura
local Aura = {}
function Aura:__index(k)

@ -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

@ -1,3 +1,4 @@
---@class Cache
local Cache = {}
Cache.__index = Cache

@ -1,6 +1,7 @@
local Tinkr, Bastion = ...
-- Define a Cacheable class
---@class Cacheable
local Cacheable = {
cache = nil,
callback = nil,

@ -1,6 +1,7 @@
local Tinkr, Bastion = ...
-- Create a new Class class
---@class Class
local Class = {}
function Class:__index(k)

@ -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]

@ -1,5 +1,5 @@
-- Create a wow command handler class
---@class Command
local Command = {}
Command.__index = Command

@ -1,5 +1,5 @@
-- Create an EventManager class
---@class EventManager
local EventManager = {
events = {},
eventHandlers = {},

@ -1,6 +1,7 @@
local Tinkr, Bastion = ...
-- Create a new Item class
---@class Item
local Item = {
UsableIfFunc = false,
PreUseFunc = false,

@ -1,6 +1,7 @@
local Tinkr, Bastion = ...
-- Create a new ItemBook class
---@class ItemBook
local ItemBook = {}
ItemBook.__index = ItemBook

@ -1,5 +1,6 @@
local Tinkr, Bastion = ...
---@class List
local List = {}
List.__index = List

@ -1,5 +1,6 @@
-- Create a module class for a bastion module
---@class Module
local Module = {}
Module.__index = Module

@ -1,5 +1,6 @@
local Tinkr, Bastion = ...
---@class MythicPlusUtils
local MythicPlusUtils = {
debuffLogging = false,
random = ''

@ -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

@ -1,5 +1,6 @@
local Tinkr, Bastion = ...
---@class ObjectManager
local ObjectManager = {}
ObjectManager.__index = ObjectManager

@ -1,6 +1,7 @@
local Tinkr, Bastion = ...
-- Define a Refreshable class
---@class Refreshable
local Refreshable = {
cache = nil,
callback = nil,

@ -1,6 +1,7 @@
local Tinkr, Bastion = ...
-- Create a new Spell class
---@class Spell
local Spell = {
CastableIfFunc = false,
PreCastFunc = false,

@ -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

@ -1,6 +1,7 @@
local Tinkr, Bastion = ...
-- Create a new Timer class
---@class Timer
local Timer = {
startTime = nil,
resetAfterCombat = false,

@ -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

@ -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)

@ -1,5 +1,6 @@
-- Create a Vector3 class
---@class Vector3
local Vector3 = {}
Vector3.__index = Vector3

@ -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 = {}

Loading…
Cancel
Save