diff --git a/.gitignore b/.gitignore index 7bb1f9d..1c25d92 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ ## Ignore mac files .DS_Store DS_Store + +## whitelist .gitkeep files +!.gitkeep + +## ignore all files in scripts +scripts/* diff --git a/src/SpellBook/SpellBook.lua b/src/SpellBook/SpellBook.lua index 952596f..c99fc8f 100644 --- a/src/SpellBook/SpellBook.lua +++ b/src/SpellBook/SpellBook.lua @@ -23,6 +23,24 @@ function SpellBook:GetSpell(id) return self.spells[id] 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 function SpellBook:GetIfRegistered(id) return self.spells[id]