2 * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
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
19 #ifndef _AUCTION_HOUSE_H
20 #define _AUCTION_HOUSE_H
22 #include "SharedDefines.h"
24 #define MIN_AUCTION_TIME (12*HOUR)
29 AUCTION_INTERNAL_ERROR
= 2,
30 AUCTION_NOT_ENOUGHT_MONEY
= 3,
31 AUCTION_ITEM_NOT_FOUND
= 4,
32 CANNOT_BID_YOUR_AUCTION_ERROR
= 10
37 AUCTION_SELL_ITEM
= 0,
49 uint32 startbid
; //maybe useless
54 uint32 deposit
; //deposit can be calculated only when creating auction
58 //this class is used as auctionhouse instance
59 class AuctionHouseObject
62 AuctionHouseObject() {}
65 for (AuctionEntryMap::iterator itr
= AuctionsMap
.begin(); itr
!= AuctionsMap
.end(); ++itr
)
69 typedef std::map
<uint32
, AuctionEntry
*> AuctionEntryMap
;
71 uint32
Getcount() { return AuctionsMap
.size(); }
73 AuctionEntryMap::iterator
GetAuctionsBegin() {return AuctionsMap
.begin();}
74 AuctionEntryMap::iterator
GetAuctionsEnd() {return AuctionsMap
.end();}
76 void AddAuction(AuctionEntry
*ah
)
79 AuctionsMap
[ah
->Id
] = ah
;
82 AuctionEntry
* GetAuction(uint32 id
) const
84 AuctionEntryMap::const_iterator itr
= AuctionsMap
.find( id
);
85 if( itr
!= AuctionsMap
.end() )
90 bool RemoveAuction(uint32 id
)
92 AuctionEntryMap::iterator i
= AuctionsMap
.find(id
);
93 if (i
== AuctionsMap
.end())
102 AuctionEntryMap AuctionsMap
;