view Classes/ContainerItem.class.lua @ 88:f1c035694545

Now trying to continue moving item 0.5 seconds after the last ITEM_LOCK_CHANGED-event, rather than 1 second after BAG_UPDATE. Skipping items which are tagged locked by the client while not tagged as locked in our addon.
author Zerotorescue
date Fri, 07 Jan 2011 10:34:38 +0100
parents 3bec0ea44607
children 67bd5057ecb7
line wrap: on
line source
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