Mercurial > wow > itemauditor
comparison Modules/Crafting.lua @ 64:e92a5adf75bf
Added first public API.
author | Asa Ayers <Asa.Ayers@Gmail.com> |
---|---|
date | Tue, 27 Jul 2010 18:00:00 -0700 |
parents | e7d287cc3b02 |
children | b6c30a5156f9 |
comparison
equal
deleted
inserted
replaced
63:e7d287cc3b02 | 64:e92a5adf75bf |
---|---|
165 self:CreateFrame('tab_crafting') | 165 self:CreateFrame('tab_crafting') |
166 end | 166 end |
167 | 167 |
168 local craftingDeciders = {} | 168 local craftingDeciders = {} |
169 | 169 |
170 function ItemAuditor:RegisterCraftingDecider(name, decider) | 170 function Crafting.RegisterCraftingDecider(name, decider) |
171 craftingDeciders[name] = decider | 171 craftingDeciders[name] = decider |
172 end | 172 end |
173 | 173 |
174 local lastWinnder = "" | 174 local lastWinnder = "" |
175 local function Decide(data) | 175 local function Decide(data) |
198 if data.profit > 0 and data.profit > ItemAuditor:GetCraftingThreshold() then | 198 if data.profit > 0 and data.profit > ItemAuditor:GetCraftingThreshold() then |
199 return 1 | 199 return 1 |
200 end | 200 end |
201 return -1 | 201 return -1 |
202 end | 202 end |
203 ItemAuditor:RegisterCraftingDecider('Is Profitable', isProfitable) | 203 Crafting.RegisterCraftingDecider('Is Profitable', isProfitable) |
204 | 204 |
205 local function tableFilter(self, row, ...) | 205 local function tableFilter(self, row, ...) |
206 -- column 5 is how many should be crafted | 206 -- column 5 is how many should be crafted |
207 return row[5] > 0 | 207 return row[5] > 0 |
208 end | 208 end |