Created
April 24, 2014 08:39
-
-
Save KonyukhovSergey/11246752 to your computer and use it in GitHub Desktop.
Revisions
-
KonyukhovSergey created this gist
Apr 24, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ public bool purchaseItem(string name, List<KeyValuePair<ItemGrade, int>> prices) { AuctionRequestParams auctionRequestParams = new AuctionRequestParams(name); List<AuctionItem> items = getAuctionBuyList(auctionRequestParams); foreach(var price in prices) { AuctionItem item = findMinimalPrice(items, price.Key, price.Value); if(item != null) { if(item.MakeAuctionBid(price.Value)) { Log("error: " + GetLastError().ToString()); } else { Log("item '" + item.item.name + "' purchased"); return true; } } } return false; }