vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 --[[
2 Auctioneer Addon for World of Warcraft(tm).
3 Version: 3.9.0.1000 (Kangaroo)
4 Revision: $Id: AucAPI.lua 972 2006-08-22 19:05:01Z mentalpower $
5  
6 Auctioneer data access and management.
7 Functions central to setting/getting any data from Auctioneer.
8  
9 Note to authors of any addons wanting to utilize Auctioneer data:
10 If you do not see the function you want here, please ask for it to be added.
11 This is the only place that we guarantee the function prototypes will not change.
12 If you use any of the internal functions, one day your addon will stop working :)
13  
14 License:
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License
17 as published by the Free Software Foundation; either version 2
18 of the License, or (at your option) any later version.
19  
20 This program is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
24  
25 You should have received a copy of the GNU General Public License
26 along with this program(see GPL.txt); if not, write to the Free Software
27 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 ]]
29  
30 --Local function prototypes
31 local getVendorBuyPrice, getVendorSellPrice
32 local setScanLength, setScanAge, getScanLength, getScanAge = Auctioneer.Statistic.SetScanLength, Auctioneer.Statistic.SetScanAge, Auctioneer.Statistic.GetScanLength, Auctioneer.Statistic.GetScanAge
33 local requestAuctionScan = Auctioneer.Scanning.RequestAuctionScan
34 --[[
35 Auctioneer.API.GetVendorBuyPrice(itemId)
36  
37 This function gets the buy price (how much it costs for the player to buy) from
38 Auctioneer's database of item prices.
39  
40 @param itemId The ID portion of the item link (the first of the four numbers).
41 @returns A price if known (may be 0 if known to have no price) or nil if unknown.
42 ]]
43 function getVendorBuyPrice(itemId)
44 if (Informant) then
45 local ret = Informant.GetItem(itemId)
46 if (ret) then return ret.buy end
47 end
48 end
49 --[[
50 Auctioneer.API.GetVendorSellPrice(itemId)
51  
52 This function gets the sell price (how much it the player will get if they sell it)
53 from Auctioneer's database of item prices.
54  
55 @param itemId The ID portion of the item link (the first of the four numbers).
56 @returns A price if known (may be 0 if known to have no price) or nil if unknown.
57 ]]
58 function getVendorSellPrice(itemId)
59 if (Informant) then
60 local ret = Informant.GetItem(itemId)
61 if (ret) then return ret.sell end
62 end
63 end
64  
65 Auctioneer.API = {
66 GetVendorBuyPrice = getVendorBuyPrice,
67 GetVendorSellPrice = getVendorSellPrice,
68  
69 --Linked from other files. PLEASE copy over the old versions when the function's prototype changes to maintain backwards compatibility.
70 --Auctioneer.Statistic
71 SetScanLength = setScanLength,
72 SetScanAge = setScanAge,
73 GetScanLength = getScanLength,
74 GetScanAge = getScanAge,
75  
76 --Auctioneer.Scanning
77 RequestAuctionScan = requestAuctionScan
78 }
79  
80 --Backwards compatiblity, please use the new prototypes whenever possible.
81 Auctioneer_GetVendorBuyPrice = getVendorBuyPrice;
82 Auctioneer_GetVendorSellPrice = getVendorSellPrice;