本文整理汇总了C++中AuctionHouseObject::Getcount方法的典型用法代码示例。如果您正苦于以下问题:C++ AuctionHouseObject::Getcount方法的具体用法?C++ AuctionHouseObject::Getcount怎么用?C++ AuctionHouseObject::Getcount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuctionHouseObject
的用法示例。
在下文中一共展示了AuctionHouseObject::Getcount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addNewAuctions
static void addNewAuctions(Player *AHBplayer, AHBConfig *config)
{
if (!AHBSeller)
return;
AuctionHouseObject* auctionHouse = objmgr.GetAuctionsMap(config->GetAHID());
uint32 items = 0;
uint32 minItems = config->GetMinItems();
uint32 maxItems = config->GetMaxItems();
uint32 auctions = auctionHouse->Getcount();
if (auctions >= minItems)
return;
if (auctions <= maxItems)
{
if ((maxItems - auctions) > ItemsPerCycle)
items = ItemsPerCycle;
else
items = (maxItems - auctions);
}
uint32 wtgbin = config->GetPercents(AHB_WHITE_TG);
uint32 gtgbin = config->GetPercents(AHB_GREEN_TG);
uint32 btgbin = config->GetPercents(AHB_BLUE_TG);
uint32 ptgbin = config->GetPercents(AHB_PURPLE_TG);
uint32 wibin = config->GetPercents(AHB_WHITE_I);
uint32 gibin = config->GetPercents(AHB_GREEN_I);
uint32 bibin = config->GetPercents(AHB_BLUE_I);
uint32 pibin = config->GetPercents(AHB_PURPLE_I);
uint32 total = wtgbin + gtgbin + btgbin + ptgbin + wibin + gibin + bibin + pibin;
uint32 pItems = 0;
uint32 bItems = 0;
uint32 gItems = 0;
uint32 wItems = 0;
uint32 pTGoods = 0;
uint32 bTGoods = 0;
uint32 gTGoods = 0;
uint32 wTGoods = 0;
for (AuctionHouseObject::AuctionEntryMap::iterator itr = auctionHouse->GetAuctionsBegin();itr != auctionHouse->GetAuctionsEnd();++itr)
{
AuctionEntry *Aentry = itr->second;
Item *item = objmgr.GetAItem(Aentry->item_guidlow);
if( item )
{
ItemPrototype const *prototype = item->GetProto();
if( prototype )
{
switch (prototype->Quality)
{
case 0:
if (prototype->Class == ITEM_CLASS_TRADE_GOODS)
wTGoods = wTGoods + 1;
else
wItems = wItems + 1;
break;
case 1:
if (prototype->Class == ITEM_CLASS_TRADE_GOODS)
wTGoods = wTGoods + 1;
else
wItems = wItems + 1;
break;
case 2:
if (prototype->Class == ITEM_CLASS_TRADE_GOODS)
gTGoods = gTGoods + 1;
else
gItems = gItems + 1;
break;
case 3:
if (prototype->Class == ITEM_CLASS_TRADE_GOODS)
bTGoods = bTGoods + 1;
else
bItems = bItems + 1;
break;
case 4:
if (prototype->Class == ITEM_CLASS_TRADE_GOODS)
pTGoods = pTGoods + 1;
else
pItems = pItems + 1;
break;
}
}
}
}
// only insert a few at a time, so as not to peg the processor
for (uint32 cnt = 1;cnt <= items;cnt++)
{
uint32 itemID = 0;
while (itemID == 0)
{
uint32 choice = urand(1, 8);
switch (choice)
{
case 1:
{
if ((purpleItems.size() > 0) && (pItems < pibin))
{
itemID = purpleItems[urand(0, purpleItems.size() - 1)];
//.........这里部分代码省略.........