diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ContainerItem.class.lua	Thu Jan 06 01:01:25 2011 +0100
@@ -0,0 +1,32 @@
+local addon = select(2, ...);
+
+-- Define the class
+
+addon.ContainerItem = {};
+addon.ContainerItem.__index = addon.ContainerItem;
+
+-- Construct
+function addon.ContainerItem:New(id)
+	local self = {};
+	
+	setmetatable(self, addon.ContainerItem);
+	
+	-- Standard info everything needs
+	self.id = id;
+	self.totalCount = 0;
+	self.locations = {};
+	
+	return self;
+end
+
+function addon.ContainerItem:AddLocation(container, slot, count)
+	table.insert(self.locations, {
+		container = container,
+		slot = slot,
+		count = count,
+	});
+	
+	self.totalCount = (self.totalCount + count);
+	
+	return true;
+end