TrinityCore
AuctionHouseBotBuyer.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef AUCTION_HOUSE_BOT_BUYER_H
19#define AUCTION_HOUSE_BOT_BUYER_H
20
21#include "Define.h"
22#include "AuctionHouseMgr.h"
23#include "AuctionHouseBot.h"
24
26{
28
31 time_t LastExist;
32};
33
35{
37
44};
45
46typedef std::map<uint32, BuyerItemInfo> BuyerItemInfoMap;
47typedef std::map<uint32, BuyerAuctionEval> CheckEntryMap;
48
50{
52
54 {
55 _houseType = houseType;
56 }
57
59
63
64private:
66};
67
68// This class handle all Buyer method
69// (holder of AuctionBotConfig for each auction house type)
71{
72public:
75
76 bool Initialize() override;
77 bool Update(AuctionHouseType houseType) override;
78
79 void LoadConfig();
80 void BuyAndBidItems(BuyerConfiguration& config);
81
82private:
85
86 void LoadBuyerValues(BuyerConfiguration& config);
87
88 // ahInfo can be NULL
89 bool RollBuyChance(BuyerItemInfo const* ahInfo, AuctionPosting const* auction);
90 bool RollBidChance(BuyerItemInfo const* ahInfo, AuctionPosting const* auction, uint32 bidPrice);
91 void PlaceBidToEntry(AuctionPosting* auction, AuctionHouseObject* auctionHouse, uint32 bidPrice);
92 void BuyEntry(AuctionPosting* auction, AuctionHouseObject* auctionHouse);
93 void PrepareListOfEntry(BuyerConfiguration& config);
94 uint32 GetItemInformation(BuyerConfiguration& config);
95 uint32 GetVendorPrice(uint32 quality);
96 uint32 GetChanceMultiplier(uint32 quality);
97};
98
99#endif
std::map< uint32, BuyerItemInfo > BuyerItemInfoMap
std::map< uint32, BuyerAuctionEval > CheckEntryMap
#define MAX_AUCTION_HOUSE_TYPE
AuctionHouseType
@ AUCTION_HOUSE_NEUTRAL
#define TC_GAME_API
Definition: Define.h:123
uint32_t uint32
Definition: Define.h:142
virtual bool Initialize()=0
virtual bool Update(AuctionHouseType houseType)=0
BuyerItemInfoMap SameItemInfo
CheckEntryMap EligibleItems
AuctionHouseType _houseType
void Initialize(AuctionHouseType houseType)
AuctionHouseType GetHouseType() const