Spellbook get list

pull/1/head
4n0n 1 year ago
parent 559c4339a4
commit e8913d3ab8
  1. 13
      src/SpellBook/SpellBook.lua

@ -27,13 +27,24 @@ end
---@return Spell, ... Spell ---@return Spell, ... Spell
function SpellBook:GetSpells(...) function SpellBook:GetSpells(...)
local spells = {} local spells = {}
for _, id in ipairs({ ... }) do for _, id in ipairs({...}) do
table.insert(spells, self:GetSpell(id)) table.insert(spells, self:GetSpell(id))
end end
return unpack(spells) return unpack(spells)
end end
---@param ... number[]
---@return List
function SpellBook:GetList(...)
local spells = {}
for _, id in ipairs({...}) do
table.insert(spells, self:GetSpell(id))
end
return Bastion.List:New(spells)
end
---@param name string ---@param name string
---@return Spell ---@return Spell
function SpellBook:GetSpellByName(name) function SpellBook:GetSpellByName(name)

Loading…
Cancel
Save