comparison ContainerItem.class.lua @ 81:58617c7827fa

Item refilling should now be working. Probably very slow if your bags, bank or guild bank is filled with over 200 unique items or so (needs some real testing, but know that it is a known (possible) issue).
author Zerotorescue
date Thu, 06 Jan 2011 01:01:25 +0100
parents
children
comparison
equal deleted inserted replaced
80:c0bf2ddb5288 81:58617c7827fa
1 local addon = select(2, ...);
2
3 -- Define the class
4
5 addon.ContainerItem = {};
6 addon.ContainerItem.__index = addon.ContainerItem;
7
8 -- Construct
9 function addon.ContainerItem:New(id)
10 local self = {};
11
12 setmetatable(self, addon.ContainerItem);
13
14 -- Standard info everything needs
15 self.id = id;
16 self.totalCount = 0;
17 self.locations = {};
18
19 return self;
20 end
21
22 function addon.ContainerItem:AddLocation(container, slot, count)
23 table.insert(self.locations, {
24 container = container,
25 slot = slot,
26 count = count,
27 });
28
29 self.totalCount = (self.totalCount + count);
30
31 return true;
32 end