Bastion aims to serve as a highly performant, simplisitic, and expandable World of Warcraft data visualization framework.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
local Tinkr, Bastion = ...
|
|
|
|
|
|
|
|
-- Create a new ItemBook class
|
|
|
|
---@class ItemBook
|
|
|
|
local ItemBook = {}
|
|
|
|
ItemBook.__index = ItemBook
|
|
|
|
|
|
|
|
-- Constructor
|
|
|
|
---@return ItemBook
|
|
|
|
function ItemBook:New()
|
|
|
|
local self = setmetatable({}, ItemBook)
|
|
|
|
self.items = {}
|
|
|
|
return self
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Get a spell from the ItemBook
|
|
|
|
---@param id number
|
|
|
|
---@return Item
|
|
|
|
function ItemBook:GetItem(id)
|
|
|
|
if self.items[id] == nil then
|
|
|
|
self.items[id] = Bastion.Item:New(id)
|
|
|
|
end
|
|
|
|
|
|
|
|
return self.items[id]
|
|
|
|
end
|
|
|
|
|
|
|
|
return ItemBook
|