comparison Classes/ContainerItem.class.lua @ 111:41f0689dfda1

This implementation of vendor buying did not work well. Too many customizations were needed that made the code hard to read and understand and eventually it was found that vendor buying should be based on refill target, not local stock. The mover/refiller is not meant for this, we should just do this somewhere else.
author Zerotorescue
date Fri, 14 Jan 2011 23:31:12 +0100
parents 67bd5057ecb7
children 239e25a058c7
comparison
equal deleted inserted replaced
110:67bd5057ecb7 111:41f0689dfda1
17 self.locations = {}; 17 self.locations = {};
18 18
19 return self; 19 return self;
20 end 20 end
21 21
22 function addon.ContainerItem:AddLocation(container, slot, count, price) 22 function addon.ContainerItem:AddLocation(container, slot, count)
23 table.insert(self.locations, { 23 table.insert(self.locations, {
24 ["container"] = container, 24 ["container"] = container,
25 ["slot"] = slot, 25 ["slot"] = slot,
26 ["count"] = count, 26 ["count"] = count,
27 ["price"] = price,
28 }); 27 });
29 28
30 -- -1 indicates unlimited supply 29 -- -1 indicates unlimited supply
31 if self.totalCount ~= -1 then 30 if self.totalCount ~= -1 then
32 if count == -1 then 31 if count == -1 then
36 end 35 end
37 end 36 end
38 37
39 return true; 38 return true;
40 end 39 end
41
42 function addon.ContainerItem:GetVendorPrice()
43 for _, loc in pairs(self.locations) do
44 if loc.price then
45 return loc.price;
46 end
47 end
48 end