forked from Bastion/Bastion
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.
24 lines
431 B
24 lines
431 B
2 years ago
|
local Tinkr, Bastion = ...
|
||
|
|
||
|
-- Create a new ItemBook class
|
||
|
local ItemBook = {}
|
||
|
ItemBook.__index = ItemBook
|
||
|
|
||
|
-- Constructor
|
||
|
function ItemBook:New()
|
||
|
local self = setmetatable({}, ItemBook)
|
||
|
self.items = {}
|
||
|
return self
|
||
|
end
|
||
|
|
||
|
-- Get a spell from the ItemBook
|
||
|
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
|