annotate 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
rev   line source
Zerotorescue@81 1 local addon = select(2, ...);
Zerotorescue@81 2
Zerotorescue@81 3 -- Define the class
Zerotorescue@81 4
Zerotorescue@81 5 addon.ContainerItem = {};
Zerotorescue@81 6 addon.ContainerItem.__index = addon.ContainerItem;
Zerotorescue@81 7
Zerotorescue@81 8 -- Construct
Zerotorescue@81 9 function addon.ContainerItem:New(id)
Zerotorescue@81 10 local self = {};
Zerotorescue@81 11
Zerotorescue@81 12 setmetatable(self, addon.ContainerItem);
Zerotorescue@81 13
Zerotorescue@81 14 -- Standard info everything needs
Zerotorescue@81 15 self.id = id;
Zerotorescue@81 16 self.totalCount = 0;
Zerotorescue@81 17 self.locations = {};
Zerotorescue@81 18
Zerotorescue@81 19 return self;
Zerotorescue@81 20 end
Zerotorescue@81 21
Zerotorescue@81 22 function addon.ContainerItem:AddLocation(container, slot, count)
Zerotorescue@81 23 table.insert(self.locations, {
Zerotorescue@81 24 container = container,
Zerotorescue@81 25 slot = slot,
Zerotorescue@81 26 count = count,
Zerotorescue@81 27 });
Zerotorescue@81 28
Zerotorescue@81 29 self.totalCount = (self.totalCount + count);
Zerotorescue@81 30
Zerotorescue@81 31 return true;
Zerotorescue@81 32 end