本文整理汇总了C++中ItemInstance::Bind方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemInstance::Bind方法的具体用法?C++ ItemInstance::Bind怎么用?C++ ItemInstance::Bind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemInstance
的用法示例。
在下文中一共展示了ItemInstance::Bind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Assert
ItemInstance * Inventory::EquipItem( EquipmentSoltID idEquipSlot, InventoryBagID idBag, UInt iSlot )
{
Assert( idBag < INVENTORYBAGID_COUNT && iSlot < INVENTORY_BAG_SIZE );
ItemInstance * pSwap = m_arrBags[idBag].arrSlots[iSlot];
if ( pSwap == NULL )
return NULL;
switch( idEquipSlot ) {
case EQUIPSLOTID_HEAD: if ( pSwap->GetClass() != ITEMCLASS_HEAD ) return NULL; break;
case EQUIPSLOTID_CHEST: if ( pSwap->GetClass() != ITEMCLASS_CHEST ) return NULL; break;
case EQUIPSLOTID_SHOULDERS: if ( pSwap->GetClass() != ITEMCLASS_SHOULDERS ) return NULL; break;
case EQUIPSLOTID_ARMS: if ( pSwap->GetClass() != ITEMCLASS_ARMS ) return NULL; break;
case EQUIPSLOTID_WRISTS: if ( pSwap->GetClass() != ITEMCLASS_WRISTS ) return NULL; break;
case EQUIPSLOTID_HANDS: if ( pSwap->GetClass() != ITEMCLASS_HANDS ) return NULL; break;
case EQUIPSLOTID_LEGS: if ( pSwap->GetClass() != ITEMCLASS_LEGS ) return NULL; break;
case EQUIPSLOTID_FEET: if ( pSwap->GetClass() != ITEMCLASS_FEET ) return NULL; break;
case EQUIPSLOTID_NECK: if ( pSwap->GetClass() != ITEMCLASS_NECK ) return NULL; break;
case EQUIPSLOTID_BELT: if ( pSwap->GetClass() != ITEMCLASS_BELT ) return NULL; break;
case EQUIPSLOTID_RING_1:
case EQUIPSLOTID_RING_2: if ( pSwap->GetClass() != ITEMCLASS_RING ) return NULL; break;
case EQUIPSLOTID_TRINKET_1:
case EQUIPSLOTID_TRINKET_2: if ( pSwap->GetClass() != ITEMCLASS_TRINKET ) return NULL; break;
case EQUIPSLOTID_TOOL_RIGHT: if ( pSwap->GetClass() != ITEMCLASS_TOOL_RIGHT ) return NULL; break;
case EQUIPSLOTID_TOOL_LEFT: if ( pSwap->GetClass() != ITEMCLASS_TOOL_LEFT ) return NULL; break;
case EQUIPSLOTID_TOOL_DISTANCE: if ( pSwap->GetClass() != ITEMCLASS_TOOL_DISTANCE ) return NULL; break;
case EQUIPSLOTID_WEAPON_RIGHT: if ( pSwap->GetClass() != ITEMCLASS_WEAPON_RIGHT ) return NULL; break;
case EQUIPSLOTID_WEAPON_LEFT: if ( pSwap->GetClass() != ITEMCLASS_WEAPON_LEFT ) return NULL; break;
case EQUIPSLOTID_WEAPON_DISTANCE: if ( pSwap->GetClass() != ITEMCLASS_WEAPON_DISTANCE ) return NULL; break;
default: Assert(false); break;
}
if ( pSwap->GetBindType() == ITEMBIND_ON_EQUIP )
pSwap->Bind();
m_arrBags[idBag].arrSlots[iSlot] = m_arrEquipmentSlots[idEquipSlot];
m_arrEquipmentSlots[idEquipSlot] = pSwap;
return pSwap;
}