aboutsummaryrefslogtreecommitdiff
path: root/src/game/AuctionHouseObject.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/AuctionHouseObject.h')
-rw-r--r--src/game/AuctionHouseObject.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/game/AuctionHouseObject.h b/src/game/AuctionHouseObject.h
index cccba8413da..f82867c5742 100644
--- a/src/game/AuctionHouseObject.h
+++ b/src/game/AuctionHouseObject.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,6 +41,15 @@ enum AuctionAction
AUCTION_PLACE_BID = 2
};
+enum AuctionLocation
+{
+ AUCTION_ALLIANCE = 2,
+ AUCTION_HORDE = 6,
+ AUCTION_NEUTRAL = 7
+};
+
+inline bool IsValidAuctionLocation(uint32 loc) { return loc == AUCTION_ALLIANCE || loc == AUCTION_HORDE || loc == AUCTION_NEUTRAL; }
+
struct AuctionEntry
{
uint32 Id;
@@ -54,7 +63,7 @@ struct AuctionEntry
time_t time;
uint32 bidder;
uint32 deposit; //deposit can be calculated only when creating auction
- uint32 location;
+ AuctionLocation location;
};
//this class is used as auctionhouse instance
@@ -84,20 +93,12 @@ class AuctionHouseObject
AuctionEntry* GetAuction(uint32 id) const
{
AuctionEntryMap::const_iterator itr = AuctionsMap.find( id );
- if( itr != AuctionsMap.end() )
- return itr->second;
- return NULL;
+ return itr != AuctionsMap.end() ? itr->second : NULL;
}
bool RemoveAuction(uint32 id)
{
- AuctionEntryMap::iterator i = AuctionsMap.find(id);
- if (i == AuctionsMap.end())
- {
- return false;
- }
- AuctionsMap.erase(i);
- return true;
+ return AuctionsMap.erase(id) ? true : false;
}
private: