本文整理汇总了C++中InventoryItemRef::SaveAttributes方法的典型用法代码示例。如果您正苦于以下问题:C++ InventoryItemRef::SaveAttributes方法的具体用法?C++ InventoryItemRef::SaveAttributes怎么用?C++ InventoryItemRef::SaveAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InventoryItemRef
的用法示例。
在下文中一共展示了InventoryItemRef::SaveAttributes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PlugImplant
void Character::PlugImplant( uint32 itemID )
{
// Get itemID, change its location to characterID
// and change the flag to flagImplant
// So now its on character's brain
InventoryItemRef item = m_factory.GetItem( itemID );
// First of all check if we already have this
Implants::iterator cur, end;
cur = m_implants.begin();
end = m_implants.end();
for(; cur != end; cur++ )
{
InventoryItemRef implant = m_factory.GetItem( cur->itemID );
if( implant == NULL ) return;
// Ok, we already have this booster, return
if( item->typeID() == implant->typeID() ) return;
}
item->MoveInto( *this, flagImplant );
EvilNumber num = 1;
item->SetAttribute( AttrIsOnline, num, true );
item->SaveAttributes();
cImplants i;
i.itemID = itemID;
m_implants.push_back( i );
}
示例2: PlugBooster
void Character::PlugBooster( uint32 itemID )
{
// Get itemID, change its location to characterID
// and change the flag to flagBooster
// So now its on character's brain
InventoryItemRef item = m_factory.GetItem( itemID );
// First of all check if we already have this
Boosters::iterator cur, end;
cur = m_boosters.begin();
end = m_boosters.end();
for(; cur != end; cur++ )
{
InventoryItemRef booster = m_factory.GetItem( cur->itemID );
if( booster == NULL ) return;
// Ok, we already have this booster, return
if( item->typeID() == booster->typeID() )return;
}
item->MoveInto( *this, flagBooster );
EvilNumber num = 1;
item->SetAttribute( AttrIsOnline, num, true );
item->SaveAttributes();
cBoosters i;
i.itemID = itemID;
i.plugDate = Win32TimeNow();
i.expiretime = item->GetAttribute( AttrBoosterDuration ).get_int();
m_boosters.push_back( i );
}