2 * Copyright (C) 2005,2006 MaNGOS <http://www.mangosproject.org/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 AUCTION_INTERNAL_ERROR
= 2
28 AUCTION_SELL_ITEM
= 0,
45 uint32 deposit
; //deposit can be calculated only when creating auction
49 //this class is used as auctionhouse instance
50 class AuctionHouseObject
53 AuctionHouseObject() {}
56 for (AuctionEntryMap::iterator itr
= AuctionsMap
.begin(); itr
!= AuctionsMap
.end(); ++itr
)
60 typedef std::map
<uint32
, AuctionEntry
*> AuctionEntryMap
;
62 uint32
Getcount() { return AuctionsMap
.size(); }
64 AuctionEntryMap::iterator
GetAuctionsBegin() {return AuctionsMap
.begin();}
65 AuctionEntryMap::iterator
GetAuctionsEnd() {return AuctionsMap
.end();}
68 void AddAuction(AuctionEntry
*ah
)
71 AuctionsMap
[ah
->Id
] = ah
;
74 AuctionEntry
* GetAuction(uint32 id
) const
76 AuctionEntryMap::const_iterator itr
= AuctionsMap
.find( id
);
77 if( itr
!= AuctionsMap
.end() )
82 bool RemoveAuction(uint32 id
)
84 AuctionEntryMap::iterator i
= AuctionsMap
.find(id
);
85 if (i
== AuctionsMap
.end())
94 AuctionEntryMap AuctionsMap
;