From e8913d3ab8c103c1f4a382706f084191182f5ff7 Mon Sep 17 00:00:00 2001 From: 4n0n <4n0n@tinkr.site> Date: Thu, 3 Aug 2023 09:08:02 -0500 Subject: [PATCH] Spellbook get list --- src/SpellBook/SpellBook.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/SpellBook/SpellBook.lua b/src/SpellBook/SpellBook.lua index c99fc8f..52119b8 100644 --- a/src/SpellBook/SpellBook.lua +++ b/src/SpellBook/SpellBook.lua @@ -27,13 +27,24 @@ end ---@return Spell, ... Spell function SpellBook:GetSpells(...) local spells = {} - for _, id in ipairs({ ... }) do + for _, id in ipairs({...}) do table.insert(spells, self:GetSpell(id)) end return unpack(spells) 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 ---@return Spell function SpellBook:GetSpellByName(name)