本文整理汇总了C++中CGameItemPtr::getLockedByOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameItemPtr::getLockedByOwner方法的具体用法?C++ CGameItemPtr::getLockedByOwner怎么用?C++ CGameItemPtr::getLockedByOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameItemPtr
的用法示例。
在下文中一共展示了CGameItemPtr::getLockedByOwner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateClientSlot
// ****************************************************************************
void CCharacterInvView::updateClientSlot(uint32 slot, const CGameItemPtr item)
{
// do nothing if client is not ready
if (!getCharacter()->getEnterFlag())
return;
if (item != NULL)
{
uint32 price;
RM_FABER_STAT_TYPE::TRMStatType itemBestStat;
getCharacter()->queryItemPrice( item, price );
itemBestStat = item->getCraftParameters() == 0 ? RM_FABER_STAT_TYPE::Unknown : item->getCraftParameters()->getBestItemStat();
BOTCHATTYPE::TBotChatResaleFlag resaleFlag = (item->durability() == item->maxDurability() ? BOTCHATTYPE::ResaleOk : BOTCHATTYPE::ResaleKOBroken);
if (item->getLockedByOwner())
{
resaleFlag = BOTCHATTYPE::ResaleKOLockedByOwner;
}
INVENTORIES::CItemSlot itemSlot( slot );
itemSlot.setItemProp( INVENTORIES::Sheet, item->getSheetId().asInt() );
itemSlot.setItemProp( INVENTORIES::Quality, item->quality() );
itemSlot.setItemProp( INVENTORIES::Quantity, item->getStackSize() );
itemSlot.setItemProp( INVENTORIES::UserColor, item->color() );
itemSlot.setItemProp( INVENTORIES::Locked, item->getLockCount() );
itemSlot.setItemProp( INVENTORIES::Weight, item->weight() / 10 );
itemSlot.setItemProp( INVENTORIES::NameId, item->sendNameId(getCharacter()) );
itemSlot.setItemProp( INVENTORIES::Enchant, item->getClientEnchantValue() );
itemSlot.setItemProp( INVENTORIES::Price, price );
itemSlot.setItemProp( INVENTORIES::ResaleFlag, resaleFlag );
itemSlot.setItemProp( INVENTORIES::ItemClass, item->getItemClass() );
itemSlot.setItemProp( INVENTORIES::ItemBestStat, itemBestStat );
itemSlot.setItemProp( INVENTORIES::PrerequisitValid, getCharacter()->checkPreRequired( item ) );
itemSlot.setItemProp( INVENTORIES::Worned, (item->getItemWornState()==ITEM_WORN_STATE::Worned));
getCharacter()->_InventoryUpdater.setItemProps( getInventory()->getInventoryId(), itemSlot );
}
else
{
// empty slot
getCharacter()->_InventoryUpdater.resetItem( getInventory()->getInventoryId(), slot );
}
// send slot update to the client
getCharacter()->_InventoryUpdater.incInfoVersion(getInventory()->getInventoryId(), slot);
}