Spellbook emmy lua

pull/1/head
4n0n 2 years ago
parent 016491fa1f
commit fa5a42b0fb
  1. 6
      .gitignore
  2. 18
      src/SpellBook/SpellBook.lua

6
.gitignore vendored

@ -1,3 +1,9 @@
## Ignore mac files ## Ignore mac files
.DS_Store .DS_Store
DS_Store DS_Store
## whitelist .gitkeep files
!.gitkeep
## ignore all files in scripts
scripts/*

@ -23,6 +23,24 @@ function SpellBook:GetSpell(id)
return self.spells[id] return self.spells[id]
end end
---@param ... number[]
---@return Spell, ... Spell
function SpellBook:GetSpells(...)
local spells = {}
for _, id in ipairs({ ... }) do
table.insert(spells, self:GetSpell(id))
end
return unpack(spells)
end
---@param name string
---@return Spell
function SpellBook:GetSpellByName(name)
local _, rank, icon, castTime, minRange, maxRange, spellID, originalIcon = GetSpellInfo(name)
return self:GetSpell(spellID)
end
---@return Spell ---@return Spell
function SpellBook:GetIfRegistered(id) function SpellBook:GetIfRegistered(id)
return self.spells[id] return self.spells[id]

Loading…
Cancel
Save