diff Classes/ContainerItem.class.lua @ 84:3bec0ea44607

Cleaned the Inventorium folder; moved all classes to classes directory, modules to modules directory and support addons to plugins directory. In addition support addons are now references within XML files rather than inside the TOC. Fixed the default local item count setting, you can now exclude bag and AH data from it. Fixed some mover algorithm bugs. Mover can no longer freeze the game but instead will terminate the process after a 1000 passes. Now reversing the moves table after making it, rather than every single time it is used. Fixed guild bank support. Now displaying the amount of items moved. Scanner now scans all guild bank tabs rather than only the current. Fixed a bug with local item data not being retrieved properly. Disabled ?enterClicksFirstButton? within dialogs as this causes the dialog to consume all keypress. Events are now at the addon object rather than local.
author Zerotorescue
date Thu, 06 Jan 2011 20:05:30 +0100
parents ContainerItem.class.lua@58617c7827fa
children 67bd5057ecb7
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Classes/ContainerItem.class.lua	Thu Jan 06 20:05:30 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